Machine Learning (ML) · Beginner level

Beginner level · Module 2: Preparing Data for Machine Learning · Lesson 1 of 3

Exploring a Data Set

Get to know data before modelling: its size, types, distributions, missing values and surprises.

In this lesson you will

  • Inspect data types, summaries and missing values
  • Use simple plots to find patterns and outliers

Key concepts

info() and describe()missing valuesdistributionoutlier

The lesson

Start every project with exploration. df.info() shows columns, types and missing counts; df.describe() summarises numbers; value_counts() shows how often each category occurs.

Histograms show the shape of a distribution, and scatter plots show relationships between two numbers. They reveal impossible values (an age of 250), outliers and categories that are spelt several ways.

Write down what you find. Exploration notes become the list of cleaning steps and questions for the people who collected the data.

Step by step

  1. Run info() and describe() on the dropout data.
  2. Count missing values per column.
  3. Plot histograms of two numeric columns.
  4. List every problem you find.

Practice activity

Write an exploration summary of the dropout data set with its main patterns and problems.

Expected result: A summary listing data size, types, missing values, outliers and inconsistent categories.

Check your understanding

  1. Which pandas method shows the number of missing values per column?

    Show answer

    df.isna().sum() (df.info() also shows non-null counts).

  2. Why explore before modelling?

    Show answer

    To find problems and patterns that affect preparation and modelling choices.

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.