v Select Rows With A Certain Value - Python

Select Rows With A Certain Value

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