Skip to content

Instantly share code, notes, and snippets.

@kxzk
Created August 9, 2019 21:35
Show Gist options
  • Save kxzk/00c2135dc0401590ce272cf967cc6cd1 to your computer and use it in GitHub Desktop.
Save kxzk/00c2135dc0401590ce272cf967cc6cd1 to your computer and use it in GitHub Desktop.
pd.qcut(data["measure"], q = 4, labels = False)
# Numeric
pd.cut(df["measure"], bins = 4, labels = False)
# Dimension
pd.cut(df["age"], bins = [0, 18, 25, 99], labels = ["child", "young adult", "adult"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment