how to fill np.nan with mode in dataframe code example Example: how to fill nan values with mean in pandas df.fillna(df.mean())