finding conditional local minima values in time series python
问题 For a time series dataset: A, How do I find the local minima (nadir values) for each ID? (local mins) B, How do I find any subsequent values that are 2 greater than each local minima. (local mins + 2) import pandas as pd df = pd.DataFrame({'id': [1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2], 'value': [8,5,3,2,1,2,3,5, 1.5, 3, 1, 1.5, 2, 3, 4, 0.4]}) For A, I was able to use the following code to find all the nadir/local minimum values from the dataset, but they are not grouped by each id. How do I modify