Skip to content

bug in MultiIndex.ak.collect #5137

Closed

Description

@ajpotts

@1RyanK reported this bug where the pandas extension array accessor for MultiIndex gives unexpected results for collect:

In [3]: import pandas as pd

In [4]: from arkouda.pandas.extension import *

In [5]: arrays = [[1, 1, 2], ["red", "blue", "red"]]
   ...: midx = pd.MultiIndex.from_arrays(arrays, names=["num", "color"])
   ...: 
   ...: print("Original MultiIndex:")
   ...: print(midx)
   ...: print("Original length:", len(midx))
   ...: 
Original MultiIndex:
MultiIndex([(1,  'red'),
            (1, 'blue'),
            (2,  'red')],
           names=['num', 'color'])
Original length: 3

In [6]: midx2 = midx.ak.collect()

In [7]: 
   ...: print("\nAfter midx.ak.collect():")
   ...: print(midx2)
   ...: print("Collected length:", len(midx2))
   ...: print("Equals original?", midx2.equals(midx))

After midx.ak.collect():
MultiIndex([(1, 'blue'),
            (2,  'red')],
           names=['num', 'color'])
Collected length: 2
Equals original? False

Activity

  1. added
    bug
    on Dec 10, 2025
  2. self-assigned this
    on Dec 10, 2025
  3. added 2 commits that reference this issue on Dec 12, 2025
    c9d4482
    f70e3bc
  4. added a commit that references this issue on Dec 18, 2025
    f641b85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions