remove columns that contain certain names in pandas

df = df.drop(df.filter(regex='Test').columns, axis=1)

Here is what the above code is Doing:
1. We are using the regex library to create a regular expression that will match any column name that contains the word ‘Test’
2. We are using the filter method to filter out the columns that match the regular expression
3. We are using the drop method to drop the columns that match the regular expression