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
Find the 1st and 3rd quartile using df.quantile and then use a mask on the dataframe.
In case you want to remove them, use no_outliers and invert the condition in the mask to get outliers.
Q1 = df.col.quantile(0.25)
Q3 = df.col.quantile(0.75)
IQR = Q3 - Q1
no_outliers = df.col[(Q1 - 1.5*IQR < df.BMI) & (df.BMI < Q3 + 1.5*IQR)]
outliers = df.col[(Q1 - 1.5*IQR >= df.BMI) | (df.BMI >= Q3 + 1.5*IQR)]