Files
histogram/examples/guide_listing_8.py
2017-11-03 18:35:01 +01:00

13 lines
276 B
Python

import histogram as bh
import numpy as np
h = bh.histogram(bh.axis.integer(0, 9))
# don't do this, it is very slow
for i in range(10):
h.fill(i)
# do this instead, it is very fast
v = np.arange(10, dtype=float)
h.fill(v) # fills the histogram with each value in the array