0
0
Pandasdata~15 mins

Detecting missing values with isna() in Pandas - Mini Project: Build & Apply

Choose your learning style9 modes available
Detecting missing values with isna()
📖 Scenario: You work as a data analyst for a small online store. You have a table of customer orders, but some information is missing. You want to find out which orders have missing data so you can fix or investigate them.
🎯 Goal: You will create a pandas DataFrame with order data, then use the isna() method to find missing values in the data.
📋 What You'll Learn
Create a pandas DataFrame with specific order data including some missing values
Create a variable to hold the result of detecting missing values using isna()
Print the DataFrame showing which values are missing
💡 Why This Matters
🌍 Real World
Detecting missing data is important in real-world data analysis to clean and prepare data for accurate results.
💼 Career
Data analysts and scientists often check for missing values to decide how to handle incomplete data before analysis.
Progress0 / 4 steps
1
Create the orders DataFrame
Import pandas as pd and create a DataFrame called orders with these exact columns and values:
'OrderID': [101, 102, 103, 104],
'Customer': ['Alice', 'Bob', None, 'David'],
'Amount': [250, None, 150, 300]
Pandas
Need a hint?

Use pd.DataFrame with a dictionary of lists for columns.

2
Create a variable to detect missing values
Create a variable called missing_values that stores the result of calling orders.isna().
Pandas
Need a hint?

Use the isna() method on the orders DataFrame.

3
Check missing values in the DataFrame
Use a print() statement to display the missing_values DataFrame.
Pandas
Need a hint?

Use print(missing_values) to see the True/False table.

4
Display missing values clearly
Print the orders DataFrame and then print the missing_values DataFrame to compare the original data with missing value locations.
Pandas
Need a hint?

Print both DataFrames one after the other to see missing values clearly.