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] Setting a float into an int dtype series through iloc should cast the series #9913

Closed
brandon-b-miller opened this issue Dec 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@brandon-b-miller
Copy link
Contributor

Describe the bug
Setting a float into a pandas series of int dtype should cast the series to float, but what happens now is the incoming scalar gets rounded and the series remains int dtype.

Steps/Code to reproduce bug

>>> psr = pd.Series([1,2,3])
>>> gsr = cudf.Series([1,2,3])
>>> psr
0    1
1    2
2    3
dtype: int64
>>> gsr
0    1
1    2
2    3
dtype: int64
>>> psr.iloc[1] = 0.5
>>> gsr.iloc[1] = 0.5
>>> psr
0    1.0
1    0.5
2    3.0
dtype: float64
>>> gsr
0    1
1    0
2    3
dtype: int64

Expected behavior
We should get the same thing as pandas here.

Environment overview (please complete the following information)
22.02

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
Came up during #8693

@brandon-b-miller brandon-b-miller added bug Something isn't working Python Affects Python cuDF API. labels Dec 15, 2021
@brandon-b-miller brandon-b-miller self-assigned this Dec 15, 2021
@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@wence-
Copy link
Contributor

wence- commented Nov 25, 2022

Fixed by #12074

@wence- wence- closed this as completed Nov 25, 2022
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

No branches or pull requests

3 participants