mars-project / mars-project/mars

[BUG] Series with multi index accessing data by index error

Open
#3,357 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.7k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Series with multi index accessing data by index error, but pandas works well.

**To Reproduce**
```python
import pandas as pd
arrays = [["m1", "m2", "m3"], ["n1", "n2", "n3"]]
idx = pd.MultiIndex.from_arrays(arrays, names=("idx_1", "idx_2"))
s = md.Series([1, 2, 3], index=multi_index)
s[("m1", "n1")]

>>> NotImplementedError: type is not support for getitem
```

**Expected behavior**
```python
>>> (No error happens)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python reproduction and trace the Series indexing entry point used by s[("m1", "n1")]. Compare the behavior with pandas and verify that tuple-based access on a MultiIndex no longer raises NotImplementedError while existing indexing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.