How to find multiple equally distributed means of a numpy array?
You could try numpy.quantile for example np.quantile(your_list, [0.33, 0.66]) I think should do the trick
Suppose I have a list of 100 numbers. I can find the mean by summing and dividing by the number of elements. But how can I find two values, one that gravitates towards the left of the list (assuming the list is ordered) and one towards the right, so that the list is equally divided into three blocks?
Sorting the array and taking the 33th and the 66th elements doesn't work because I could have all 1's before the 33th position and bigger values after, so the 33th position would be too early in the array. Those two 'means' depend on the values of the array and not solely on the indices.
I'm sure what I'm trying to do has a proper naming but I can't really remember it now.