So I am trying to remove the outlier by making a function :
def remove_outlier_IQR(data):
Q1 = data.quantile(0.25)
Q3 = data.quantile(0.75)
Inter_Q = Q3-Q1
df_final = [~((data<(Q1 - 1.5*Inter_Q)) | (data>(Q3 + 1.5*Inter_Q)))]
return df_final
Then I remove the outlier onto the designated column with the outlier.
df_outlier_removed=remove_outlier_IQR(df[["Umur","Skor Belanja (1-100)"]])
df_outlier_removed.dropna(axis=0, inplace=True)
df_outlier_removed
However, it returns the error as
AttributeError: 'list' object has no attribute 'dropna'