Data Science · Beginner level

Beginner level · Module 1: The Data Science Process · Lesson 3 of 3

Tools: Notebooks and pandas

Set up a notebook environment and use pandas to load, inspect and select data.

In this lesson you will

  • Load a CSV into a pandas DataFrame and inspect it
  • Select columns and filter rows

Key concepts

DataFrameread_csvhead, info, describefiltering rows

The lesson

pandas is the main Python library for tables. df = pd.read_csv("survey.csv") loads a file into a DataFrame; df.head() shows the first rows, df.info() the columns and types and df.describe() summary statistics.

Select columns with df["district"] or df[["district", "minutes_to_water"]]. Filter rows with a condition: df[df["minutes_to_water"] > 30].

Notebooks keep code, results and explanations together. Write short notes explaining each step, so the analysis can be checked and repeated.

Step by step

  1. Open a notebook in Colab or Jupyter.
  2. Load the water survey CSV.
  3. Inspect it with head, info and describe.
  4. Filter households that walk over 30 minutes.

Practice activity

Load the water survey and answer three simple questions with selections and filters.

Expected result: A notebook answering the three questions with short explanations.

Check your understanding

  1. Which method shows column types and missing counts?

    Show answer

    df.info().

  2. How do you keep only rows where a column is above 30?

    Show answer

    df[df["column"] > 30].

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.