Skip to content

Conversation

@wdhorton
Copy link

For #19

Confirm that all values in a df or by column match a given regex pattern

Uses pandas.Series.str.match, and allows kwargs to be passed through to that call (case, flags, na).

return df


def matches_regex(df, pattern, columns=None, **kwargs):
Copy link
Owner

@ZaxR ZaxR Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of passing a dictionary of pattern: columns, so that different columns can be checked for different patterns in the same check? Otherwise you might have to call this check a number of times. Trying to balance the simplest possible interface with the most flexibility

@ZaxR
Copy link
Owner

ZaxR commented Jul 29, 2019

Thank you so much the the PR! I just added a comment when you get a chance to take a look. So excited to get this functionality merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants