-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In-place updates with loc or iloc don't work correctly when the LHS h…
…as more than one column (#9918) Fixes: #7377 This PR enables to `setitem` using a scalar value, dataframe or array/list iterable in both `DataframeLocIndexer `and `DataFrameIlocIndexer `. Only the following cases are currently supported in cudf: - Scalar value: follows the original code path, assigns column- values via specified key (row-label) - Dataframe : checks for column-alignment in LHS and RHS, then uses a scatter map of the indices to assign column-values accordingly. Substitute NA for columns not found in the RHS - All other cases (array, list, range value, etc) : first conversion to cupy array followed by special handling: * If 2d array: If the inner dimension is 1, it's broadcastable to all columns of the dataframe. * Otherwise the value must be a 1d array (scalar values are handled in case 1 above), there are 2 subcases: * If the key on column axis is a scalar, meaning the user is indexing a single column; Therefore 1d value should assign along the columns. * Otherwise, the key on column axis is a 1d array. In this case, the key on row axis can be a scalar or 1d and in both cases of row key, the ith element in value corresponds to the ith row in the indexed object. If the key is 1d, a broadcast will happen. Authors: - Sheilah Kirui (https://github.com/skirui-source) - Michael Wang (https://github.com/isVoid) - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Ashwin Srinath (https://github.com/shwina) - GALI PREM SAGAR (https://github.com/galipremsagar) - Michael Wang (https://github.com/isVoid) URL: #9918
- Loading branch information
1 parent
dd68db3
commit 1a457ef
Showing
4 changed files
with
286 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters