Is there a built-in way to do filtering on a column by IQR(i.e. values between Q1-1.5IQR and Q3+1.5IQR)? also, any other possible generalized filtering in pandas suggested
Another approach using Series.between():
iqr = df['col'][df['col'].between(df['col'].quantile(.25), df['col'].quantile(.75), inclusive=True)]
Drawn out:
q1 = df['col'].quantile(.25) q3 = df['col'].quantile(.75) mask = d['col'].between(q1, q3, inclusive=True) iqr = d.loc[mask, 'col']