Skip to content

Instantly share code, notes, and snippets.

@rhizoome
Last active December 16, 2015 20:10
Show Gist options
  • Save rhizoome/5490355 to your computer and use it in GitHub Desktop.
Save rhizoome/5490355 to your computer and use it in GitHub Desktop.
In [8]: df = pandas.DataFrame(['tree', 'water']); df
Out[8]:
0
0 tree
1 water
In [9]: df[0].str.match("(.*ree.*)")
Out[9]:
0 (tree)
1 []
Name: 0
In [10]: df[df[0].str.match("(.*ree.*)").apply(lambda x: len(x) != 0)]
Out[10]:
0
0 tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment