Skip to content

Instantly share code, notes, and snippets.

@Ze1598
Last active May 4, 2020 15:27
Show Gist options
  • Save Ze1598/9b5197ecfd88a8f53e7ac4fad7ecc217 to your computer and use it in GitHub Desktop.
Save Ze1598/9b5197ecfd88a8f53e7ac4fad7ecc217 to your computer and use it in GitHub Desktop.
Bin data using custom intervals with pandas (floats): usage
work_hours = pd.Series(np.random.random_sample(200,)) * 72 + 8
work_hours_binned = bin_work_hours(work_hours)
plot_histogram(
work_hours_binned,
10,
"Work Week Hours binned",
["Work week hours", None]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment