mars-project / mars-project/mars

Support dataframe indexing using df.iloc with mars tensor

Open
#2,353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mod: dataframe type: feature
Dominant language
Python
Stars
2.7k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

`df.iloc` now supports integer, slice, ndarray and bool tensor, `TensorFancyIndexHandler` could be implemented to support indexing with mars tensor.

Here is the sample code:
``` Python
a = md.DataFrame([1,2,3,4])
a.iloc[mt.tensor([2, 3]),:].execute()
```

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

Locate the TensorFancyIndexHandler mentioned in the issue and inspect how df.iloc currently handles integer, slice, ndarray, and bool tensor indexes. Use the provided DataFrame example as the starting case; done means the mars tensor index executes successfully and returns the selected rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.