Issue
Is there a way to check if one value of a vector is greater/smaller than the next one? Without using loops?
This is the vector: 1 2 4 3 6 9
And this would be the answer i need: true true false true true
Solution
Try looking at the diff
function in numpy
. That will give you the difference between each value and its right neighbor. You can then check if that value is smaller or larger than 0.
Answered By - Bart.Doekemeijer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.