I have the following inputs:
index_array
array([ 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.])
success_rate_array
array([ 0.14436074, 0.15488785, 0.17158958, 0.19350282, 0.20358402,
0.21188935, 0.23390895, 0.26160338, 0.1971831 , 0.31818182])
x_e
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
y_e
array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
My call to create a 2d histogram:
H, x_e, y_e = np.histogram2d(sucess_rate_array, index_array, bins=(x_e, y_e))
is failing:
ValueError: The dimension of bins must be equal to the dimension of the sample x.
As you can see above (and as I verify programmatically) in fact all 4 inputs have identical dimensions of (10, ) although I would have though it's only necessary that x_e
and y_e
have the same shape as one another and that success_rate_array
and index_array
have the same shape. Also I don't have an Inf
or NaN
values. What am I doing wrong?