Loading data
Read CSV, Excel and JSON files and check what actually arrived.
What you will be able to do
- Use read_csv, read_excel and read_json.
- Inspect with head, info and isna.
- Parse dates explicitly.
- Keep the raw file unchanged.
In plain English
Data rarely arrives clean. Read the file, inspect the first rows, check dtypes and missing values. Pass explicit parsing options so dates and separators are not guessed incorrectly.
import pandas as pd
df = pd.read_csv('lessons.csv', parse_dates=['published_at'])
print(df.head())
print(df.info())
print(df.isna().sum())Your turn
EasyRead a CSV with dates
Read lessons.csv and parse the published_at column as dates.
PYTHON · starter
df = pd.read_csv('lessons.csv')Check your understanding before moving on.
Knowledge checkQuestion 1
Which method shows column dtypes and non-null counts?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.