Created
January 20, 2020 07:12
-
-
Save hadinh1306/64efecb1d5dd321ae19055edef4f5faf 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
| rating_bins = [0, 1, 2, 3, 4, 5] | |
| rating_bin_labels = ['0-1', '1-2', '2-3', '3-4', '4-5'] | |
| df['RatingGroups'] = pd.cut(df['Stars'], rating_bins, include_lowest=True, right=True, labels=rating_bin_labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment