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

[Enh]: Add support for Series|Expr.is_finite #1297

Open
FBruzzesi opened this issue Nov 1, 2024 · 1 comment · May be fixed by #1341
Open

[Enh]: Add support for Series|Expr.is_finite #1297

FBruzzesi opened this issue Nov 1, 2024 · 1 comment · May be fixed by #1341
Assignees
Labels
enhancement New feature or request

Comments

@FBruzzesi
Copy link
Member

We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?

Noticed in the inline comment in a Tubular PR

Please describe the purpose of the new feature or describe the problem to solve.

Add is_finite methods

Suggest a solution if possible.

No response

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

No response

@FBruzzesi FBruzzesi added the enhancement New feature or request label Nov 1, 2024
@FBruzzesi FBruzzesi self-assigned this Nov 1, 2024
@FBruzzesi
Copy link
Member Author

I have a change in a branch which is 95% ready.
Only discussion needed is how to treat nan's and null's in pandas and its possible backends.

For polars:

import polars as pl

data = {"a": [float("nan"), float("inf"), 2.0, None]}
pl.Series(data["a"]).is_finite()

shape: (4,)
Series: '' [bool]
[
        false
        false
        true
        null
]

For pandas it is hard to distinguish between nulls and nan in a consistent way across all backends

@FBruzzesi FBruzzesi linked a pull request Nov 9, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant