df['Age'] = df['Age'].fillna(df['Age'].mean()) df['Cost'] = df['Cost'].fillna(df['Cost'].median()) df.dropna( subset=['PatientID','Name','CancerType','Hospital'], inplace=True ) print(df)