Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new check: matches_regex #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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).

@@ -408,6 +408,35 @@ def is_same_as(df, df_to_compare, **kwargs):
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