df_new=df.fillna(0, inplace=True)
print(df_new.head(10))
why does it shows AttributeError: 'NoneType' object has no attribute 'head'
df_new=df.fillna(0, inplace=True)
print(df_new.head(10))
why does it shows AttributeError: 'NoneType' object has no attribute 'head'
inplace=True
makes it directly modify the original dataframe.
So you would either not to that, like:
df_new = df.fillna(0)
print(df_new.head(10))
Or just keep it as df
:
df.fillna(0, inplace=True)
print(df.head(10))