Created
October 6, 2021 04:09
-
-
Save andreachello/399cf90e817f846f037095f847951903 to your computer and use it in GitHub Desktop.
This file contains 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
# Create a list of float colums to check for skewing | |
mask = df.dtypes == float | |
float_cols = df.columns[mask] | |
skew_limit = 0.75 # define a limit above which we will log transform | |
skew_vals = df[float_cols].skew() | |
# Showing the skewed columns | |
skew_cols = (skew_vals | |
.sort_values(ascending=False) | |
.to_frame() | |
.rename(columns={0:'Skew'}) | |
.query('abs(Skew) > {}'.format(skew_limit))) | |
skew_cols.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment