We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DataFrame
columns = cudf.MultiIndex.from_tuples([('A', 'one'), ('A', 'two')]) df = cudf.DataFrame(np.random.randn(2, 2), columns=columns) df
Output:
(A, one) (A, two) 0 -1.004870 1.253556 1 0.176658 0.856762
Expected output:
A one two 0 -0.926630 0.718061 1 -0.920203 -0.074759
The text was updated successfully, but these errors were encountered:
Maybe this?
diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 0fe8949090..cc57091539 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -722,6 +722,8 @@ class DataFrame(IndexedFrame, Serializable, GetAttrGetItemMixin): if dtype: self._data = self.astype(dtype)._data + # Fix up + self._data.multiindex = isinstance(columns, pd.MultiIndex) @_cudf_nvtx_annotate def _init_from_series_list(self, data, columns, index):
Sorry, something went wrong.
Preserve names of column object in various APIs (#13772)
f00e922
This PR preserves column names in various APIs by retaining `self._data._level_names` and also calculating when to preserve the column names. Fixes: #13741, #13740 Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Bradley Dice (https://github.com/bdice) - Ashwin Srinath (https://github.com/shwina) - Lawrence Mitchell (https://github.com/wence-) URL: #13772
galipremsagar
Successfully merging a pull request may close this issue.
Output:
Expected output:
The text was updated successfully, but these errors were encountered: