I would like to convert a numpy array into 5 classes: very low, low, average, high, very high; based on whether the values are -2 or more std. dev away from the mean of the array (for very low); -1 std. dev or more away from the mean (for low class); between -1 and +1 std. dev from the mean (for average); between +1 and +2 std. dev from mean (for high class) and greater than +2 std. dev. from the mean (for very high class).
I tried using stats.perentileofscore, but that does not give me what I want:
arr = np.random.rand(100)
[stats.percentileofscore(x, a, 'rank') for a in arr]