how to use pandas filter with IQR

As far as I know, the most compact notation seems to be brought by the query method. # Some test data np.random.seed(33454) df = ( # A standard distribution pd.DataFrame({‘nb’: np.random.randint(0, 100, 20)}) # Adding some outliers .append(pd.DataFrame({‘nb’: np.random.randint(100, 200, 2)})) # Reseting the index .reset_index(drop=True) ) # Computing IQR Q1 = df[‘nb’].quantile(0.25) Q3 = … Read more

tech