Lesson 4: Loading Data – CSV, Excel, JSON & More

1. Loading CSV Files

CSV = Comma-Separated Values — most common ML data format.

df = pd.read_csv("iris.csv")
print(df.head())

Useful parameters:

Exercise 1

If CSV has no header row, what parameter to use?

2. Other Formats

Common in ML: CSV for tabular data, JSON for API responses.

Exercise 2

To load only columns "sepal_length" and "species" from "iris.csv":
df = pd.read_csv("iris.csv", =["sepal_length", "species"])

Exercise 3

Which formats does Pandas support natively?
← Previous Lesson (3) Next Lesson (5) →