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

[REVIEW] Add __setitem__() #2442

Merged
merged 101 commits into from
Aug 12, 2019
Merged

[REVIEW] Add __setitem__() #2442

merged 101 commits into from
Aug 12, 2019

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Jul 31, 2019

Fixes #1468

Enables setting values of a Series by position or label via s[key] = value, s.iloc[key] = value and s.loc[key] = value. key can be:

  • A scalar value
  • A range of values (utilizes cudf::copy_range)
  • A Series-like of values (utilizes cudf::scatter)
  • A boolean mask (utilizes cudf::scatter)

Adds Series.at and Series.iat as aliases for Series.loc and Series.iloc.

Also enables df.iloc[key] = value and df.loc[key] = value for DataFrames.

Not supported:

  1. Setting rows of a DF
  2. df.loc for dataframes with a MultiIndex

shwina and others added 30 commits July 16, 2019 10:42
Copy link
Collaborator

@kkraus14 kkraus14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, had a few minor comments, but they can be dealt with in followups

@kkraus14 kkraus14 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Aug 12, 2019
@kkraus14 kkraus14 merged commit 5b3675d into rapidsai:branch-0.9 Aug 12, 2019
wence- added a commit to wence-/cudf that referenced this pull request Oct 11, 2022
To mimic pandas, we must upcast a column to the numpy result_type of
the column itself and the input value dtype. This previously occurred
in all relevant cases except when the index provided to __setitem__
was a single integer (originally introduced in rapidsai#2442). Closes rapidsai#11901.
rapids-bot bot pushed a commit that referenced this pull request Nov 4, 2022
To mimic pandas, we must upcast a column to the numpy result_type of the column itself and the input value dtype. This previously occurred in all relevant cases except when the index provided to __setitem__ was a single integer (originally introduced in #2442). Closes #11901.

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

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Bradley Dice (https://github.com/bdice)

URL: #11904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Assignment by index
7 participants