0
Python data science
def missing(df,column_name): ##Start Code df[df.gender.isnull().sum()] ## End Code this is th erro ipython-input-28-6e164c723942> in <module> ----> 1 missing(df,'gender') <ipython-input-25-01108b799fe1> in missing(df, column_name) 1 def missing(df,column_name):
3 Réponses
0
What You Likely Want:
You want to filter and return rows where the column has missing values. Here's the corrected version:
def missing(df, column_name):
return df[df[column_name].isnull()]
Example Usage:
missing_rows = missing(df, 'gender')
print(missing_rows)
This will return all rows in your DataFrame df where the 'gender' column has a NaN (missing) value.
- 1
mm you can sum null values?