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):

2nd Apr 2021, 7:04 PM
Athini Mbiko
Athini Mbiko - avatar
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.
17th Jul 2025, 11:19 AM
Mayank kumar Verma
Mayank kumar Verma - avatar
- 1
mm you can sum null values?
2nd Apr 2021, 11:35 PM
Alfonso FarĂ­as
Alfonso FarĂ­as - avatar