pandas check if substring appears in column names code example Example: get columns containing string df2 = df.filter(regex='spike') print(df2)