I have an array with N (positive) points. I would like to find M bin edges of a histogram such that all the bars have the same height. In other words I want to find M+1 points such that the count of array points between two consecutive bin edges is the same.
Example
>>> array = [0.3 0.3 0.3 0.7 0.8 0.9]
>>> M = 2
>>> binPartition(array, M)
[0, 0.5, 1]
I would appreciate an answer in python and numpy but a link to a known algorithm will suffice! Thank you! :)