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
This works cudf.pivot(df, index='x', columns='y', values='z')
This doesn't work cudf.pivot(df, index='x', columns='y', values='z123')
KeyError Traceback (most recent call last)
Input In [18], in
----> 1 cudf.pivot(df, index="x", columns="y", values="z123")
File ~/anaconda3/envs/rapids-22.02/lib/python3.8/site-packages/cudf/core/reshape.py:924, in pivot(data, index, columns, values)
920 values = df._columns_view(
921 col for col in df._column_names if col not in (index, columns)
922 )
923 else:
--> 924 values = df._columns_view(values)
925 if index is None:
926 index = df.index
File ~/anaconda3/envs/rapids-22.02/lib/python3.8/site-packages/cudf/core/dataframe.py:5580, in DataFrame._columns_view(self, columns)
5575 def _columns_view(self, columns):
5576 """
5577 Return a subset of the DataFrame's columns as a view.
5578 """
5579 return DataFrame(
-> 5580 {col: self._data[col] for col in columns}, index=self.index
5581 )
File ~/anaconda3/envs/rapids-22.02/lib/python3.8/site-packages/cudf/core/dataframe.py:5580, in (.0)
5575 def _columns_view(self, columns):
5576 """
5577 Return a subset of the DataFrame's columns as a view.
5578 """
5579 return DataFrame(
-> 5580 {col: self._data[col] for col in columns}, index=self.index
5581 )
Describe the bug
cudf.pivot doesn't understand "values" when it's column name instead of list and the column name includes numeric
Steps/Code to reproduce bug
This works
cudf.pivot(df, index='x', columns='y', values='z')
This doesn't work
cudf.pivot(df, index='x', columns='y', values='z123')
This works
cudf.pivot(df, index='x', columns='y', values=['z123'])
This works
cudf.pivot(df, index='x', columns='y', values=['z', 'z123', '123z'])
Environment overview
cudf version is "22.02.00"
The text was updated successfully, but these errors were encountered: