Loading...

Lag Column

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium

Problem

A window function step computes the previous value for each element in a time-series column. Return a list of the same length where each element is the value immediately before it in the input; the first element has no predecessor so it should be None.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.