Table of Contents
ToggleBefore analyzing or modeling, we need to **read**, **understand**, and **explore** our dataset. In this lesson, you’ll learn to use Pandas to load data and peek into its structure — a critical step in every data science project.
read_csv()Use Pandas to load CSV (Excel-like) datasets into Python:
import pandas as pd
df = pd.read_csv("data.csv")
Note: Your file must be in the same directory (or provide full path).
df.head() – View first 5 rowsdf.tail() – View last 5 rowsdf.shape – Rows × Columnsdf.columns – Column namesdf.info() – Data types, null valuesdf.describe() – Summary stats (mean, std, min, etc.)These commands help you quickly assess the quality and quantity of your dataset.
Start every ML project by using df.info() and df.describe() to spot missing values, wrong data types, and outliers early.
👉 Up next: You’ll dive into handling missing values and detecting outliers in real datasets.
