Last active
November 19, 2020 21:03
-
-
Save winnydejong/86b4150b16f231dee511e6884c86394f to your computer and use it in GitHub Desktop.
Regex filter: select rows if column matches regex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import pandas as pd | |
#returns rows that match regexpattern for given column | |
df[df.COLUMNNAME.str.match('REGEXPATTERN', re.IGNORECASE)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment