Pandas & Data Analysis·Pandas from first Series to analysis project

Loading data

Read CSV, Excel and JSON files and check what actually arrived.

Beginner 12 min read Lesson 3 of 300 Challenge included
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.

load.pyPython
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

Read a CSV with dates

Easy

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 in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Cleaning data
Lesson 3 of 300 · 0% of course