You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Unable to update values of a dataframe for a column of type array for a subset of rows via .loc with a list[list].
Tested with versions: 24.02.02 & nightly 24.04.00a508
Updating the values for all rows works:
df['a'] = [[0,0,0], [9, 10, 11], [20, 21, 22]]
however updating a subset of rows with a bool mask fails:
df.loc[mask, 'a'] =new_values
I believe at least part of the problem is (python/cudf/cudf/core/column/lists.py) ~line 90:
def __setitem__(self, key, value):
if isinstance(value, list):
value = cudf.Scalar(value)
if isinstance(value, cudf.Scalar):
if value.dtype != self.dtype:
raise TypeError("list nesting level mismatch")
When the column is ListDtype(int64) and the incoming values look like [[9, 10, 11], [20, 21, 22]]
It will create a cudf.Scalar which will have a dtype of ListDtype(ListDtype(int64)) .
Describe the bug
Unable to update values of a dataframe for a column of type array for a subset of rows via
.loc
with alist[list]
.Tested with versions: 24.02.02 & nightly 24.04.00a508
Updating the values for all rows works:
however updating a subset of rows with a bool mask fails:
I believe at least part of the problem is (python/cudf/cudf/core/column/lists.py) ~line 90:
When the column is
ListDtype(int64)
and the incoming values look like[[9, 10, 11], [20, 21, 22]]
It will create a
cudf.Scalar
which will have a dtype ofListDtype(ListDtype(int64))
.Causing the
value.dtype != self.dtype
to fail.Steps/Code to reproduce bug
Expected behavior
Update the values
Environment overview (please complete the following information)
The text was updated successfully, but these errors were encountered: