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

Support inline conditional expression #26

Closed
LucasG0 opened this issue Feb 18, 2023 · 0 comments · Fixed by #28
Closed

Support inline conditional expression #26

LucasG0 opened this issue Feb 18, 2023 · 0 comments · Fixed by #28

Comments

@LucasG0
Copy link
Owner

LucasG0 commented Feb 18, 2023

For instance

def func(val):
    return val if val == 0 else 0
s = s.apply(func)

should be converted to

s = np.select(conditions=[(s == 0)], choices=[s], default=0)
@LucasG0 LucasG0 linked a pull request Feb 18, 2023 that will close this issue
@LucasG0 LucasG0 closed this as completed Feb 18, 2023
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 a pull request may close this issue.

1 participant