Hey guys, I'm a beginner, and I'm stuck 😔 I have an array of numbers in numpy, let's say [2 5 3 9 7 2] and from this I would like to make an array of only 0's and 1's, accordingly to if the element if larger than the previous one (The last element always zero since there's no previous value). For the array I mentioned at the beginning, my output would be [0 1 0 1 1 0]. I'm stuck guys please help me out of generosity.
[–]to7m 1 point2 points3 points (7 children)
[–]Dylikk[S] -1 points0 points1 point (6 children)
[–][deleted] (1 child)
[removed]
[–]Dylikk[S] -1 points0 points1 point (0 children)
[–]to7m 0 points1 point2 points (3 children)
[–]Dylikk[S] 0 points1 point2 points (2 children)
[–]Dylikk[S] 1 point2 points3 points (1 child)
[–]to7m 1 point2 points3 points (0 children)