1def exercise4(df):
2 df1 = df.select_dtypes(np.number)
3 df2 = df.select_dtypes(exclude = 'float')
4 mode = df2.mode()
5 df3 = df1.fillna(df.mean())
6 df4 = df2.fillna(mode.iloc[0,:])
7 new_df = [df3,df4]
8 df5 = pd.concat(new_df,axis=1)
9 new_cols = list(df.columns)
10 df6 = df5[new_cols]
11 return df6