Is there function that can remove the outliers?

前端 未结 4 918
生来不讨喜
生来不讨喜 2021-01-19 10:17

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

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 10:59

    def outlier():
        import pandas as pd
        df1=pd.read_csv("......\\train.csv")
        _, bp = pd.DataFrame.boxplot(df1, return_type='both')
        outliers = [flier.get_ydata() for flier in bp["fliers"]]
        out_liers = [i.tolist() for i in outliers]
    

提交回复
热议问题