Reputation: 21
I have a big dataframe with large number of nan cells. Does the mean function include nan cells in its calculation in python?
Upvotes: 1
Views: 196
Reputation: 1398
You can add skipna=True
or skipna=False
DataFrame.mean( axis=None,
skipna=True, # If you set skipna to True it will skip NaN
level=None,
numeric_only=None,
**kwargs)
skipna Boolean. Exclude NaN values (skipna=True) or include NaN values (skipna=False)
Upvotes: 2