Skip to content
Back to skills

Apply Groupby Window

ASecurity

"Apply, transform, groupby aggregation, and rolling or expanding

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolsgosqlexpressapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill apply-groupby-window --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Apply Groupby Window?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Apply Groupby Window
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-apply-groupby-window/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-apply-groupby-window)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: apply-groupby-window
description: "Apply, transform, groupby aggregation, and rolling or expanding
  window workflows for Koalas."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Apply, GroupBy, And Window Workflows

Use this sub-skill when a Koalas task needs custom higher-order computation, pandas UDF-style batch functions, grouped aggregation, or rolling/expanding windows.

## Route Here For

- Choosing between `DataFrame.apply`, `DataFrame.transform`, `DataFrame.koalas.apply_batch`, `DataFrame.koalas.transform_batch`, and the deprecated `DataFrame.map_in_pandas` alias.
- `Series.apply`, `Series.map`, `Series.transform`, and `Series.koalas.transform_batch`.
- `GroupBy.apply`, `GroupBy.transform`, `DataFrameGroupBy.agg`/`aggregate`, `ks.NamedAgg`, grouped reductions, cumulative operations, filtering, ranking, `get_group`, and SeriesGroupBy-only helpers.
- `DataFrame.rolling`, `Series.rolling`, `DataFrame.expanding`, `Series.expanding`, plus `groupby(...).rolling(...)` and `groupby(...).expanding(...)`.
- Koalas and pandas return type hints that prevent schema inference and avoid an extra Spark job.

## Route Elsewhere

- Basic DataFrame/Series/Index creation, conversion, indexing, reshaping, dtype, string, datetime, missing-value, and categorical work: [core-dataframes](../core-dataframes/SKILL.md).
- Spark SQL, IO, Spark accessors, `to_spark`, Spark `DataFrame.to_koalas`, and Spark-column-only transforms: [spark-io-sql](../spark-io-sql/SKILL.md).
- Global options and performance settings such as `compute.ops_on_diff_frames`, `compute.shortcut_limit`, default index type, plotting, and extension accessors: [configuration-extensions](../configuration-extensions/SKILL.md). This sub-skill explains where those options affect apply/groupby/window choices.

## Read First

1. For API choice and examples, read [references/apply-groupby-window.md](references/apply-groupby-window.md).
2. For failures and performance symptoms, read [references/troubleshooting.md](references/troubleshooting.md).

## Fast Decision Rules

- Use `transform`/`transform_batch` only when every partition or group returns the same number of rows as it received.
- Use `apply`/`apply_batch` when the result can be shorter, longer, scalar per group, or a new frame shape.
- Prefer built-in grouped reductions or `agg` over `GroupBy.apply` whenever the computation is expressible as named aggregations.
- Add return type hints to any non-trivial apply/transform/batch/groupby function before running it on large or already-shuffled data.
- Treat ungrouped rolling/expanding and global ranking as small-data or carefully validated workflows because they can require single-partition Spark windows.

Files in this skill

  • SKILL.md2.7 KB
  • references/apply-groupby-window.md13.2 KB
  • references/troubleshooting.md7.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.