Select Rows That Have A Certain Value

Want to learn more? I recommend these Python books: Python for Data Analysis, Python Data Science Handbook, and Introduction to Machine Learning with Python.

import pandas as pd
# Create an example dataframe
data = {'name': ['Jason', 'Molly'],
        'country': [['Syria', 'Lebanon'],['Spain', 'Morocco']]}
df = pd.DataFrame(data)
df
country name
0 [Syria, Lebanon] Jason
1 [Spain, Morocco] Molly
df[df['country'].map(lambda country: 'Syria' in country)]
country name
0 [Syria, Lebanon] Jason