Created
April 5, 2021 04:14
-
-
Save adhadse/1bb0e50152031d9b22adac71d1e572e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def determine_outlier_thresholds_iqr(dataframe, col_name, th1=0.25, th3=0.75): | |
quartile1 = dataframe[col_name].quantile(th1) | |
quartile3 = dataframe[col_name].quantile(th3) | |
iqr = quartile3 - quartile1 | |
upper_limit = quartile3 + 1.5 * iqr | |
lower_limit = quartile1 - 1.5 * iqr | |
return lower_limit, upper_limit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment