0

I had calculated the percentage of outliers in my dataset using the IQR method and I got the next result:

enter image description here

I want to remove outliers for Wind Speed and Pressure using z1 score is that possible?

I got my data set from the next site: my data and I used the next function to calculate the outliers percentage:

def outlier_percent(data):
    Q1 = data.quantile(0.25)
    Q3 = data.quantile(0.75)
    IQR = Q3 - Q1
    minimum = Q1 - (1.5 * IQR)
    maximum = Q3 + (1.5 * IQR)
    num_outliers =  np.sum((data < minimum) |(data > maximum))
    num_total = data.count()
    return (num_outliers/num_total)*100
FObersteiner
  • 22,500
  • 8
  • 42
  • 72
baddy
  • 369
  • 1
  • 3
  • 23
  • 1
    Could you please share some reproducible data? – Quinten Oct 01 '22 at 08:47
  • 1
    what's the point of detecting outliers with iqr but removing them with z-score? – filippo Oct 01 '22 at 09:07
  • I want to know if the outliers are the same for each method means points detect as outliers with IQR are going to be detected the same with Score – baddy Oct 01 '22 at 09:10
  • 1
    take a look at https://stackoverflow.com/questions/23199796/detect-and-exclude-outliers-in-a-pandas-dataframe – filippo Oct 01 '22 at 09:24

0 Answers0