forward

Moving forward in a panda dataframe looking for the first occurrence of multi-conditions with reset

Moving forward in a panda dataframe looking for the first occurrence of multi-conditions with reset Question: I am having trouble with multi-conditions moving forward in a dataframe. Here’s a simplification of my model: import pandas as pd import numpy as np df = pd.DataFrame({ ‘date’:pd.date_range(start=’2022-05-12′, periods=27), ‘l’: [10.0,9.9,11.1,10.9,12.1,9.6,13.1,17.9,18.0,15.6,13.5,14.2,10.5,9.5,7.6,9.8,10.2,15.3,17.7,21.8,10.9,18.9,16.4,13.3,7.1,6.8,9.4], ‘c’: [10.5,10.2,12.0,11.7,13.5,10.9,13.9,18.2,18.8,16.2,15.1,14.8,11.8,10.1,8.9,10.5,11.1,16.9,19.8,22.0,15.5,20.1,17.7,14.8,8.9,7.3,10.1], ‘h’: [10.8,11.5,13.4,13.6,14.2,11.4,15.8,18.5,19.2,16.9,16.0,15.3,12.9,10.5,9.2,11.1,12.3,18.5,20.1,23.5,21.1,20.5,18.2,15.4,9.6,8.4,10.5], ‘oc’: [False,True,False,False,False,True,True,True,False,False,True,False,True,False,False,False,False,True,False,False,False,False,False,False,False,False,False], ‘s’: …

Total answers: 1