1 Histogram Done

Run Settings
LanguagePython
Language Version
Run Command
import numpy as np data = np.random.randint(low=1,high=10, size=100) print('data = ' + str(data)) # get the histogram of the data, number of elements with value 1,2,...,10 dist = np.histogram(data,bins=[1,2,3,4,5,6,7,8,9]) print('dist = ' + str(dist)) # get the number of elements in the histogram, should be 100 N = np.sum(d for d in dist[0]) print('N = ' + str(N))
Editor Settings
Theme
Key bindings
Full width
Lines