Skip to content

Instantly share code, notes, and snippets.

@Kamaldeep0077
Created December 5, 2020 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kamaldeep0077/74ce4df300205e9d44b3f08031470525 to your computer and use it in GitHub Desktop.
Save Kamaldeep0077/74ce4df300205e9d44b3f08031470525 to your computer and use it in GitHub Desktop.
#name of groups
groups = ['Low', 'Med', 'High', 'Exp']
data['Item_MRP_Bin_qcut'] = pd.qcut(data['Item_MRP'], q=4, labels=groups)
data[['Item_MRP', 'Item_MRP_Bin_qcut']].head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment