You can pass the bin edges to the bins argument directly in np.histogram.
From the docs:

bins int or sequence of scalars or str, optional
If  bins  is an int, it defines the number of equal-width bins in the given range (10, by default). If  bins  is a sequence, it defines a monotonically increasing array of bin edges, including the rightmost edge, allowing for non-uniform bin widths.
New in version 1.11.0.
If  bins  is a string, it defines the method used to calculate the optimal bin width, as defined by  histogram_bin_edges  1.