Use the ** isnull () ** function.
Variable to which DataFrame is assigned .isnull ()
True if missing values are included, False otherwise.
Use the ** isnull () ** and ** sum () ** functions.
Variable to which DataFrame is assigned .isnull (). Sum ()
Use the ** dropna () ** function.
Variable to which DataFrame is assigned.dropna ()
After using the ** dropna () ** function, assign it to another variable or add the ** dropna ** argument replace = True
, and rewrite the variable as it is when executed.
data = data.dropna()
data.dropna(inplace=True)
data = data.dropna(inplace=True)
If you want to delete data where a particular column contains missing values
DataFrame.dropna (subset = ['column name'])
The ** fillna () ** function fills a missing value in a particular column with a value.
Variable to which DataFrame is assigned ['column']. Fillna (value)
Fill in the missing values with the mean of a particular column.
Variable to which DataFrame is assigned ['column']. Mean ()
Recommended Posts