Initializing playground…
← Back to roadmap

resample()

Time-based resampling and aggregation for Series and DataFrame · mirrors pandas.DataFrame.resample

Example 1 — Daily sum of a price Series

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Example 2 — Monthly mean with month-start labels

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Example 3 — OHLC (Open-High-Low-Close) aggregation

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Example 4 — DataFrame resample with per-column aggregations

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Example 5 — Weekly resample (labeled by Sunday)

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Example 6 — Custom aggregation function

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent