1

I have a DataFrame df which has 300000 rows and 75 columns. One of Columns of this dataframe has 165 NaN.
I want to use the fillna() to fill up the null value, but it seems that Nothing really happens. The 165 NaN values are still there. What my code is as follows:

df=df.fillna({'Col':df['Col'].mean()})

I don't know why it didn't work. Is it because of the large amount of NaN values?

Fan
  • 189
  • 1
  • 3
  • 11

0 Answers0