http://www.idlcoyote.com/math_tips/ra...
for example
x = [-0.5d, -0.45d, -0.4d, -0.35d, -0.3d, -0.25d] ; this should be a uniform distribution
h = histogram(x, binsize=0.05d, loc=loc, min=-0.5d, max=-0.25d)
but h is strange result!!
print, h;; [2 1 0 1 1 1]
but 'x' and 'loc' equal!!
print, array_equal(x, h)
but python numpy.histogram is good
import numpy as np
x = [-5.50,-5.45,-5.40,-5.35,-5.30,-5.25]
h, loc = np.histogram(x, bins=6, range=[-5.5, -5.2])
pirnt h
Is there a fundamental solution is to improve the histogram function??
thanks