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] LocIndexing a float index with integer slice does not respect end point #13902

Closed
mroeschke opened this issue Aug 17, 2023 · 0 comments · Fixed by #13925
Closed

[BUG] LocIndexing a float index with integer slice does not respect end point #13902

mroeschke opened this issue Aug 17, 2023 · 0 comments · Fixed by #13925
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@mroeschke
Copy link
Contributor

Describe the bug
LocIndexing a float index with integer slice does not respect end point

Steps/Code to reproduce bug

In [53]: import cudf

In [54]: cudf.__version__
Out[54]: '23.10.00'

In [79]: ser = cudf.Series(range(3), index=[2.0, 3.0, 4.5])

In [80]: ser
Out[80]: 
2.0    0
3.0    1
4.5    2
dtype: int64

In [81]: ser.loc[2:4]
Out[81]: 
2.0    0
3.0    1
4.5    2
dtype: int64

In [82]: ser.to_pandas().loc[2:4]
Out[82]: 
2.0    0
3.0    1
dtype: int64

Expected behavior
Though there could be int/float precision issues, in this case 4.5 should be clearly excluded with a slice endpoint of 4

Environment overview (please complete the following information)

  • Environment location: Bare-metal
  • Method of cuDF install: conda
    • If method of install is [Docker], provide docker pull & docker run commands used

Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details

Additional context
Add any other context about the problem here.

@mroeschke mroeschke added bug Something isn't working Needs Triage Need team to review and classify labels Aug 17, 2023
@galipremsagar galipremsagar added Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Aug 18, 2023
@galipremsagar galipremsagar self-assigned this Aug 18, 2023
rapids-bot bot pushed a commit that referenced this issue Aug 22, 2023
Fixes: #13902 

This PR fixes a type-casting issue with `searchsorted` where typecast was done to the `values` dtype instead of inspecting both input and values columns and converting them to common dtypes.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)

URL: #13925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants