The five reductions pandas has and AggKind does not
- Dominant language
- Mojo
- Stars
- 1
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
#330 exposed twelve of the seventeen reductions `AggKind` already had. This issue is about the ones on the other side of the ledger: reductions pandas has that firepanda has no kernel for at all.
- **`prod`** and `cumprod`'s whole column counterpart. A running product exists in `firepanda/kernel/cumulative.mojo` so the fold is written, but there is no `AggKind` for the reduced form and no group by product either. Probably the smallest of these.
- **`kurt`** and its alias `kurtosis`. `skew` is implemented as `AggKind.SKEW` with the pandas normalisation, and kurtosis is the next moment up with the same shape of bias correction, so this is the one that most directly reuses existing machinery.
- **`any`** and **`all`**. Both are boolean folds with an early exit and both have a `bool_only` and a `skipna` argument. pandas has a specific empty case worth copying rather than deriving: `pd.Series([], dtype=bool).all()` is True and `.any()` is False.
- **`mode`**. The awkward one, because it does not answer a scalar. `mode` answers a series of every value tied for most frequent, so it needs the distinct count machinery `nunique` already uses plus a way to return more than one row, and its shape does not fit the boundary method the other twelve go through.
- **`idxmin`** and **`idxmax`**. Answer an index label rather than a value, so they need the index rather than only the column, and on an empty column pandas raises rather than answering missing.
These are listed together because they are all "pandas reduces this and firepanda has no kernel", not because they are one piece of work. `prod` and `kurt` are table entries once the kernel exists. `any` and `all` are a fold with an early exit. `mode` and the two `idx` reductions each answer a different shape and each needs its own boundary.
Splitting this into separate issues once somebody picks one up is fine. It is one issue now so the list exists somewhere other than in a PR description.
Follow-up to #330. Part of the M6 work tracked in #8.
Contributor guide
Research direction
Start with firepanda/kernel/cumulative.mojo and the existing AggKind.SKEW and nunique machinery. Choose one reduction first, then trace the boundary method used by the existing reductions and compare its required result shape with pandas. Done means the selected reduction has its kernel, aggregation entry point, and pandas-compatible empty, null, and result-shape behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100