'Finding first index before value steps outside of boundary, numpy
Imagine we got large dataframe where: column 1 is time and column 2 is the value. I wanna know all indices n where: The values of n, n-1, n-2, n-3, ...., n-x are all inside boundary and the value of n+1 is outside a boundary. I tried it via np.where, looking promising. I am able to find all points n where n+1 is outside of the boundaries, but I only need those, where n-1, ..., n-k are inside the boundaries too, not just n.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
