I find a function to detect outliers from columns but I do not know how to remove the outliers
is there a function for excluding or removing outliers from the colum
An easy solution would be to use scipy.stats.zscore
from scipy.stats import zscore
# calculates z-score values
df["zscore"] = zscore(df["Pre_TOTAL_PURCHASE_ADJ"])
# creates `is_outlier` column with either True or False values,
# so that you could filter your dataframe accordingly
df["is_outlier"] = df["zscore"].apply(lambda x: x <= -1.96 or x >= 1.96)