Last active
July 26, 2022 15:07
-
-
Save elowy01/c371ad36c68f088e1efa9e9b6aae94c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bins numerical data and returns the different counts for each category | |
mport numpy as np | |
a = np.array([22,87,5,43,56,73,55,54,11,20,51,5,79,31,27]) | |
hist,bins = np.histogram(a,bins = [0,20,40,60,80,100]) | |
print(hist) # [3 4 5 2 1] | |
print(bins) # [ 0 20 40 60 80 100] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment