Skip to content

Instantly share code, notes, and snippets.

@r-brink
Created January 23, 2024 13:00
Show Gist options
  • Save r-brink/24d5a4db6e958bbb792673198cd56da1 to your computer and use it in GitHub Desktop.
Save r-brink/24d5a4db6e958bbb792673198cd56da1 to your computer and use it in GitHub Desktop.
from datetime import date, timedelta
import numpy as np
import polars as pl
np.random.seed(42)
dates = pl.date_range(
date(2025, 1, 1), date(2025, 12, 31), timedelta(days=1), eager=True
)
prices = 100 + np.random.randn(dates.len()).cumsum()
df = pl.DataFrame({"StockPrice": prices, "Dates": dates})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment