82. Data Cleaning Methods
Here are some methods for cleaning data when using pandas dataframe: Delete data with empty district df.dropna(subset=[“COLUMN_NAME”]) Delete the whole attribute which includes empty data df.drop(“COLUMN_NAME”,axis=1) Replace empty data with other elements(Such as median) median = df[“COLUMN_NAME”].median() df[“COLUMN_NAME”].fillna(median,inplace=True) When replacing…