Using the magic of list comprehensions:
[df.index[i - len(pattern)] # Get the datetime index
for i in range(len(pattern), len(df)) # For each 3 consequent elements
if all(df['ColA'][i-len(pattern):i] == pattern)] # If the pattern matched
# [Timestamp('2017-07-10 00:00:00')]
Related Contents:
- is it possible to do fuzzy match merge with python pandas?
- How to drop rows of Pandas DataFrame whose value in a certain column is NaN
- cartesian product in pandas
- Performant cartesian product (CROSS JOIN) with pandas
- Set value for particular cell in pandas DataFrame using index
- Extracting just Month and Year separately from Pandas Datetime column
- Fast punctuation removal with pandas
- Pandas: Chained assignments [duplicate]
- How to convert string to datetime format in pandas python?
- How to take column-slices of dataframe in pandas
- Pandas DataFrame Groupby two columns and get counts
- How to add multiple columns to pandas dataframe in one assignment?
- Split a large pandas dataframe
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- How to shift a column in Pandas DataFrame
- Pandas: peculiar performance drop for inplace rename after dropna
- How do I find numeric columns in Pandas?
- How to select all columns whose names start with X in a pandas DataFrame
- Pandas – Explanation on apply function being slow
- Remove reverse duplicates from dataframe
- Take multiple lists into dataframe
- How to remove square bracket from pandas dataframe
- How do I filter a pandas DataFrame based on value counts?
- How to flatten a hierarchical index in columns
- How to flatten a nested JSON recursively, with flatten_json
- Normalize columns of a dataframe
- Coalesce values from 2 columns into a single column in a pandas dataframe
- Max and Min date in pandas groupby
- Pandas max value index
- Pandas lookup from one of multiple columns, based on value
- Pandas Latitude-Longitude to distance between successive rows [duplicate]
- How to concatenate multiple column values into a single column in Pandas dataframe
- Filling missing values using forward and backward fill in pandas dataframe (ffill and bfill)
- How to sort a Pandas DataFrame by index?
- Best way to join two large datasets in Pandas
- How to read a .xlsx file using the pandas Library in iPython?
- Drop columns whose name contains a specific string from pandas DataFrame
- Bin pandas dataframe by every X rows
- Apply fuzzy matching across a dataframe column and save results in a new column
- How to increment a row count in groupby in DataFrame
- Turn Pandas Multi-Index into column
- Problem in combining bar plot and line plot
- Round each number in a Python pandas data frame by 2 decimals
- Locate first and last non NaN values in a Pandas DataFrame
- Diff of two Dataframes
- pandas merging based on a timestamp which do not match exactly
- Remove NaN ‘Cells’ without dropping the entire ROW (Pandas,Python3)
- Python pandas / matplotlib annotating labels above bar chart columns [duplicate]
- How to merge a Series and DataFrame
- How to format IPython html display of Pandas dataframe?