'locating a value from a fluctuating data in a dataframe column?
i have a dataframe column with a data which mainly gose down in value from 1 to 0.3. but the data has a fluctuating behavior as it tends to shoot up for some data points and then starts decrease again.
i need to find the value which reaches 0.8. but if i get data like r= [1, 0.9, 0.84, 0.8, 0.83, 0.82, 0.8, 0.76, 0,70] how can i get the last value of 0.8
i found this code but it actually finds the first values that reaches 0.8
df.loc[df['r']>0.8].values[-1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
