parse icon indicating copy to clipboard operation
parse copied to clipboard

Usage with pandas df.str.extract and .match?

Open marfel opened this issue 1 year ago • 0 comments

I have several large DataFrames I need to apply regex to. From what I understand, parse uses compiled regexes internally, therefore it should be possible to use them with pandas. But when writing something like

extracted = df.mycolumn.str.extract(parse.compile(my_regex))

pandas throws

TypeError: first argument must be string or compiled pattern

Is the re.Pattern in the parser.Parser object accessible from the outside somewhere?

marfel avatar Jan 12 '24 07:01 marfel