Skip to content

Instantly share code, notes, and snippets.

@satkr7
Last active August 26, 2020 06:57
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 satkr7/b5227187a99b5d82ee01ba7b45d7f3cb to your computer and use it in GitHub Desktop.
Save satkr7/b5227187a99b5d82ee01ba7b45d7f3cb to your computer and use it in GitHub Desktop.
import pandas as pd
# load height-weight dataset downloaded from kaggle
data = pd.read_csv("weight-height.csv")
#equal width binning
data["ewb"] = pd.cut(data["Height"], bins=10)
#equal frequency binning
data["efb"] = pd.qcut(data["Height"], q=10)
print(data["ewb"].value_counts())
print(data["efb"].value_counts())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment