Solution 2: Pandas Essentials
Let’s look at the solution related to NumPy essentials.
Task 1: Count of NaN in the DataFrame
Calculate how many NaN
we have in our dataset.
Hint: use
isnull()
.
Solution
Press + to interact
def number_of_nulls_in_each_column():# Your Code Herelist = pay.isnull().sum()print("Nans in each column")print(list)nans = []for nan in list:nans.append(nan)return sum(nans)print("Total Number of Nans in our DataFrame : ", number_of_nulls_in_each_column())
Explanation
We use the ...