Created
December 6, 2020 07:22
-
-
Save Kamaldeep0077/f541897e08ad2b634b05ea84f7ea0f61 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
#define bins | |
bins = [0, 70, 140, 210, 280] | |
#name of groups | |
groups = ['Low', 'Med', 'High', 'Exp'] | |
data['Item_MRP_Bin_cut'] = pd.cut(data['Item_MRP'], bins=bins, labels=groups) | |
data[['Item_MRP', 'Item_MRP_Bin_cut']].head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment