Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to fillna in all columns with their mean values

# if you want to fill NaN in a single column with its mean value
df['col'].fillna(df['col'].mean(), inplace=True)

# if you want to fill NaN in more than one columns with their respective mean values
df.fillna(df.mean(), inplace=True)
 
PREVIOUS NEXT
Tagged: #fillna #columns #values
ADD COMMENT
Topic
Name
2+6 =