vendredi 15 juillet 2016

useing regular expression for column filter


I have a pandas DataFrame that contains a year and a title. Some of rows.name are Batman, Catman etc. I am trying to get all rows of the format .*man, using the following expression:

t[t.title & re.search(r'.*man', t.title)]

This Fails. Is there an idiomatic way to accomplish this?


Aucun commentaire:

Enregistrer un commentaire