For example, I have
arr=np.linspace(0,1,11)
and I want to mark numbers n<0.25 label "a", n>0.75 label "c", numbers between label "b". the result would be
array(['a', 'a', 'a', 'b', ..., 'c'])
I tried things like arr[arr<0.25]='a', but it will only work once since there will be strings comparing with float on the next command. I can achieve this by checking its type before comparison using a for loop, but it is complicated. Is there a straight forward way to achieve this?