I have a df, with a column that contains a list. for example -
df = pd.DataFrame({'name': ['name1', 'name2', 'name3', 'name4'],
'age': [21, 23, 24, 28],
'occupation': ['data scientist', 'doctor', 'data analyst', 'engineer'],
'knowledge':[['python','c++'], ['python', 'c#'], ['css','js','html'], ['c#']],
})
now, I want to locate only the rows with 'python' as one of the 'knowledge' values in the list. how do I do that?
I tried to do: pd.loc[(pd['knowledge'].isin['python'])] and it didn't work
(edited to fix the code)