elastic / elastic/eland

Implement `ed_df.groupby([...]).indices`

Open
#326 2 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted topic:dataframe
Dominant language
Python
Stars
693
Forks
112
PR merge metrics
No merged PRs in 30d

Description

- Implement `.indices` similar to pandas
Example:
```python
>>> pd_ecommerce.groupby(["currency","type"]).indices
{('EUR', 'order'): array([ 0, 1, 2, ..., 4672, 4673, 4674], dtype=int64)}
>>> pd_flights.groupby(["Cancelled"]).indices
{False: array([ 0, 1, 2, ..., 13056, 13057, 13058], dtype=int64), True: array([ 3, 8, 12, ..., 13037, 13048, 13051], dtype=int64)}
```
How this works in Pandas: We return a dictionary where values are the positions of that document in the entire index.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the DataFrame groupby implementation behind `ed_df.groupby([...]).indices` and compare its behavior with the pandas examples in the issue. Confirm how grouped rows map to positions in the full index, then verify that `.indices` returns the expected dictionary for single- and multi-column grouping. No source file or test is named, and the issue has not had recent activity.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, pandas, python
Domain
data, databases
Issue type
Feature
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.