0
0
Pandasdata~5 mins

NaN and None in Pandas - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does NaN represent in Pandas?

NaN stands for 'Not a Number'. It is used to represent missing or undefined numerical data in Pandas.

Click to reveal answer
beginner
How is None treated in Pandas DataFrames?

None is treated as a missing value in object columns. For numerical columns, it is converted to NaN.

Click to reveal answer
beginner
Which Pandas function can you use to check for missing values including NaN and None?

You can use DataFrame.isna() or DataFrame.isnull() to check for missing values. Both treat NaN and None as missing.

Click to reveal answer
intermediate
What happens when you perform arithmetic operations on NaN values in Pandas?

Any arithmetic operation involving NaN results in NaN. This helps keep track of missing data through calculations.

Click to reveal answer
beginner
How can you replace NaN or None values in a DataFrame?

You can use DataFrame.fillna(value) to replace missing values with a specified value.

Click to reveal answer
What does NaN stand for in Pandas?
ANumber zero
BNull and None
CNot a Number
DNegative number
Which function checks for missing values in a Pandas DataFrame?
ADataFrame.fillna()
BDataFrame.isna()
CDataFrame.dropna()
DDataFrame.sum()
How does Pandas treat None in a numeric column?
AAs <code>NaN</code>
BAs zero
CAs a string 'None'
DRaises an error
What is the result of adding a number to NaN in Pandas?
AThe number
BZero
CAn error
D<code>NaN</code>
Which method replaces missing values in a DataFrame?
Afillna()
Bisna()
Cdropna()
Dreplace()
Explain how Pandas handles NaN and None values in DataFrames.
Think about missing data and how Pandas shows it.
You got /4 concepts.
    Describe how you can find and replace missing values in a Pandas DataFrame.
    Focus on checking and fixing missing data.
    You got /3 concepts.