1# Basic syntax to select rows that contain one substring:
2import pandas as pd
3df[df['column_name'].str.contains('substring')]
4
5# Note, this only returns rows that contain substring in the specified
6# column, it doesn't look for the substring in all columns
7# Note, substring can be replaced with any REGEX expression
8
9# Basic syntax to select rows that contain 2+ substrings:
10import pandas as pd
11df[df['column_name'].str.contains('substring_1|substring_2')]
12# Where you can keep adding substrings to look for separated by |
13
14# Basic syntax to select rows that do not contain substring:
15import pandas as pd
16df[~df['column_name'].str.contains('substring')]
17# Where the ~ acts as a NOT to negate the results of the search