Search⌘ K

Solution 2: Pandas Essentials

Explore how to efficiently analyze data using pandas by counting missing values, calculating statistics like minimum, maximum, and average, and grouping employee data by salary type. This lesson equips you with essential skills to manipulate and derive insights from datasets.

Task 1: Count of NaN in the DataFrame

Calculate how many NaN we have in our dataset.

Hint: use isnull().

Solution

Python 3.5
def number_of_nulls_in_each_column():
# Your Code Here
list = 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 ...