I am running the following code to generate bin counts. But the line "if int(psx[i]*100) not in prob_bins" returns error: TypeError: only size-1 arrays can be converted to Python scalars.
What is wrong with the code?
In the code, variables y_true and psx are 1D arrays.
for j in range(len(y_true)):
if y_true[j] == 0:
if int(psx*100) not in prob_bins:
prob_bins[int(psx*100)] = 1
else:
prob_bins[int(psx*100)] += 1