Finding the % of missing values from the entire dataset

Viewed 43

The shape of my dataset is (130,20) which can be found using the df.shape command of python. I also found out the total number of missing values in the data set using df.isnull().sum().sum() command.

Now I want to know the % of missing values in the dataset.

Total value 130*20 = 2600

total missing values = 850

% of missing values (850/2600)*100 = 32.69%

I am not sure my method is alright for fining % of missing values.

Any help would be appreciated.

1 Answers

I usually do

df.isna().to_numpy().ravel().mean()

Or

df.isna().mean().mean()
Related