I am using the percentile() function of Numpy in the following code, but it gives an error: "IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices"
th_0 = np.percentile(probs_0[idx_0], frac)
In the above code, probs_0 is a Numpy array, idx_0 is a set of indices, and frac is 50.
What is wrong this code?