[go: nahoru, domu]

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

Is this correct? #131

Closed
vineetbansal opened this issue Jun 14, 2022 · 2 comments
Closed

Is this correct? #131

vineetbansal opened this issue Jun 14, 2022 · 2 comments

Comments

@vineetbansal
Copy link
Collaborator
vineetbansal commented Jun 14, 2022

AFAIK, '|' doesn't need to be escaped and '\|' will look for a backslash followed by a pipe. If that's not the intention here, this may need investigating.

phases['FLIP'] = phases.PHASE.str.contains('1\|0').astype(np.int8)

@mmyers1
Copy link
Member
mmyers1 commented Jun 29, 2022

By default pandas.str.contains treats the first argument as a regex, hence the escape character. It's probably clearer to use regex=False instead.

@mmyers1
Copy link
Member
mmyers1 commented Jun 29, 2022

Addressed in commit 1159c2a

@mmyers1 mmyers1 closed this as completed Jun 29, 2022
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

No branches or pull requests

2 participants