Created
October 11, 2019 01:49
-
-
Save zgulde/2e27b9450e4c0a6510d06df7db32d0a5 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
In [148]: def various_scales(s: pd.Series): | |
...: df = pd.DataFrame() | |
...: df['original'] = s | |
...: df['min_max'] = MinMaxScaler().fit_transform(s.values.reshape(-1, 1)) | |
...: df['percentile'] = s.rank(pct=True) | |
...: df['rank'] = s.rank() | |
...: df['z_score'] = StandardScaler().fit_transform(s.values.reshape(-1, 1)) | |
...: return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment