How to fill the missing values in pandas dataframe using python?



I am quite new to data analysis with python.I have a data frame df with missing values in one of the columns which I dont want to drop.How should I treat those missing values or fill them to proceed with my work.Please help me with the functions that I can use in pytho for the same.


You can do this in following manner:
Suppose u want to fill in the missing places with the mean of that column and the column name be ‘Fare’ and the dataframe be df then we use:

import numpy as np
meanFare = np.mean(df.Age)
df.Fare = df.Fare.fillna(meanFare)

Here fillna function fills the NaN values with the given value in the bracket.