If the array is np.array([1, 3, 1, 5, 5, 5, 6, 3, 6, 3])
, then I want to get array like this; np.array([0, 0, 1, 0, 1, 2, 0, 1, 1, 2])
. Is there any numpy options? Or do I have to make new function?
Asked
Active
Viewed 30 times
1
-
Yea. But I got a new error. – UNGGI LEE Jul 15 '22 at 05:38
-
this is my data: [144 144 144 144 143 143 143 93 93 93 93 93 93 93 93 93 93] and this is what I got: [3 2 1 0 2 1 0 9 0 6 5 4 3 2 1 7 8] I want to get data like this: [0, 1, 2, 3, 0, 1, 2, 0, 1 ...] – UNGGI LEE Jul 15 '22 at 05:40
-
@mozway. Nice find. The dupe hammer is strong today, but actually good questions for the most part – Mad Physicist Jul 24 '22 at 18:01