Skip to content

Instantly share code, notes, and snippets.

@Ze1598
Last active May 4, 2020 15:27
Show Gist options
  • Save Ze1598/bb87349091a822bd3843334ea42fc5a5 to your computer and use it in GitHub Desktop.
Save Ze1598/bb87349091a822bd3843334ea42fc5a5 to your computer and use it in GitHub Desktop.
Bin data using custom intervals with pandas (integers): usage
ages = pd.Series(np.random.randint(low=0, high=99, size=200))
ages_binned = bin_ages(ages)
plot_histogram(
ages_binned,
10,
"Ages binned",
["Ages", None]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment