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
A call to .stack() on a DataFrame with MultiIndex columns by some level results in a DataFrame whose columns are sorted lexicographically (does not preserve the original order).
Since the original column order was 'b' and 'a', the expected output is
b a
0 2 NaN 3.0
3 1.0 NaN
1 2 NaN 4.0
3 2.0 NaN
This is reproducible on Google Colab using the Rapids installer.
On a related note, I believe stack() in pandas behave like this in older versions (e.g. 1.5) but it preserves the original order in newer versions (e.g. 2.2).
The text was updated successfully, but these errors were encountered:
Fantastic! @amanlai our nightly packages should contain these fixes if you're interested in trying them out! I'm closing this issue for now, but please feel free to reopen if you require further help!
Describe the bug
A call to
.stack()
on a DataFrame with MultiIndex columns by some level results in a DataFrame whose columns are sorted lexicographically (does not preserve the original order).The following constructor:
creates a DataFrame that looks like
Stacking it using
df.stack()
producesSince the original column order was
'b'
and'a'
, the expected output isThis is reproducible on Google Colab using the Rapids installer.
On a related note, I believe
stack()
in pandas behave like this in older versions (e.g. 1.5) but it preserves the original order in newer versions (e.g. 2.2).The text was updated successfully, but these errors were encountered: