Created
June 16, 2022 18:10
-
-
Save crodriguez1a/0214db9d315912c21b2b57e0beb5383a 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
from pandas import DataFrame, Series | |
def compute_bounds(series: DataFrame) -> tuple: | |
Q1:Series = series.quantile(0.25) | |
Q3:Series = series.quantile(0.75) | |
IQR:np.float = Q3 - Q1 | |
lower_lim: float = Q1 - 1.5 * IQR | |
upper_lim: float = Q3 + 1.5 * IQR | |
return (lower_lim, upper_lim) | |
# compute_bounds(df.Age) -> (20.0, 92.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment