[Python] Add pyarrow.TableGroupBy() subtables
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the enhancement requested
```python
import pyarrow as pa
t = pa.table([
pa.array(["a", "a", "b", "b", "c"]),
pa.array([1, 2, 3, 4, 5]),
], names=["keys", "values"])
for subtable in pa.TableGroupBy(t,"keys"): # loop over the 3 tables
subtable.to_pandas() # with the keys column
# alternatively
for key_name, subtable in pa.TableGroupBy(t,"keys"): # loop over the 3 tables
subtable.to_pandas() # without the keys column
```
### Component(s)
Python
Contributor guide
Research direction
Start at the requested Python entry point, pa.TableGroupBy, and review how the existing pa.Table and grouping-related APIs are exposed. Define the iteration behavior for grouped subtables, including the alternatives with and without the keys column, and verify it with the example shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100