Kotlin / Kotlin/dataframe

Is there a solution for lead/lag/shift of values on a column?

Open
#522 2 comments 0 reactions 0 assignees View on GitHub
API enhancement
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

I'd like to lead/lag/shift values within a groupBy. I can't find any examples or API for that and therefore wanted to raise a question.
I would expect a syntax to be similar to following (assuming the data set with incidents:

```
df.groupBy("Date").aggregate {
lag("IncidentTime", 1) into "PrevIncidentTime"
}
```

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the existing groupBy and aggregate APIs, then check whether any column-shift or window operations already exist. Done would require a decided grouped lead/lag/shift API and its implementation, tests, and usage documentation; the issue does not define that scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.