-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
releasedIncluded in a releaseIncluded in a release
Description
Is your feature request related to a problem?
There is currently no way to group the rows of a Table by a specific criteria.
Desired solution
- New method
group_byinTable - It should take one parameter
key_selector: Callable[[Row], _T]that computes the grouping key for a row._Tis a type parameter. - The function should return a
dict[T, Table]. The keys are the values computed by thekey_selectorthe values are the rows mapped to that key combined to aTable
Example:
Table:
| col1 | col2 |
|---|---|
| 1 | "a" |
| 1 | "b" |
| 2 | "c" |
| 2 | "d" |
| 3 | "e" |
Key selector:
lambda row: row["col1"]Expected result:
1:
| col1 | col2 |
|---|---|
| 1 | "a" |
| 1 | "b" |
2:
| col1 | col2 |
|---|---|
| 2 | "c" |
| 2 | "d" |
3:
| col1 | col2 |
|---|---|
| 3 | "e" |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
releasedIncluded in a releaseIncluded in a release
Type
Projects
Status
✔️ Done