Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreachello/399cf90e817f846f037095f847951903 to your computer and use it in GitHub Desktop.
Save andreachello/399cf90e817f846f037095f847951903 to your computer and use it in GitHub Desktop.
# 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