Re:Pythonic monotonic
by comex on Friday August 13, 2021 @02:44PM
(#28172726)
Here's my version, which has one loop for increasing sequences, and another loop for decreasing sequences. I think that makes it easier to understand what's going on. It properly handles runs of equal elements, and it handles neither-greater-nor-lesser values like NaN in a relatively principled fashion: putting them in a run by themselves. Perhaps this code is over-commented.
[ Parent
| on HN ]
There are no comments on this comment yet.