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

[BUG] Index.is_monotonic_* methods not factoring nan values #15776

Open
galipremsagar opened this issue May 17, 2024 · 0 comments
Open

[BUG] Index.is_monotonic_* methods not factoring nan values #15776

galipremsagar opened this issue May 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When nan values are present, Index.is_montonic_* methods seem to be returning incorrect results:

Steps/Code to reproduce bug

In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: idx = pd.Index([1.0, 2.0, np.nan])

In [4]: idx
Out[4]: Index([1.0, 2.0, nan], dtype='float64')

In [5]: idx.is_monotonic_increasing
Out[5]: False

In [6]: import cudf

In [7]: gidx = cudf.from_pandas(idx, nan_as_null=False)

In [8]: gidx
Out[8]: Index([1.0, 2.0, nan], dtype='float64')

In [9]: gidx.is_monotonic_increasing
Out[9]: True

Expected behavior
Match pandas.

@galipremsagar galipremsagar added bug Something isn't working cudf.pandas Issues specific to cudf.pandas labels May 17, 2024
@galipremsagar galipremsagar self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas
Projects
Status: In Progress
Development

No branches or pull requests

2 participants
@galipremsagar and others