I\'d like to find a particular pattern in a pandas dataframe column, and return the corresponding index values in order to subset the dataframe.
Here\'s a sample dat
for col in df: index = df[col][(df[col] == pattern[0]) & (df[col].shift(-1) == pattern[1]) & (df[col].shift(-2) == pattern[2])].index if not index.empty: print(index)