pool is a dataframe, and one of the columns is "Name" If key == 'Bob', then this line correctly gives me all the rows where Name=='Bob':
keyrows = pool[key == pool.Name]
I instead want to get all the rows that match 'Bob', like "Bob Jones" and "Bob Marley", etc.
So I changed '==' to 'in', but it doesn't work as I expected:
keyrows = pool[key in pool.Name]
I get KeyError: False
Any help would be much appreciated.
.str.containsor.str.match. see here for examples