How do I get the first, last occurrence (>0) of a particular column in a time series
df,
shape: (4, 3)
┌────────────┬────────────┬────────────┐
│ date ┆ column_one ┆ column_two │
│ --- ┆ --- ┆ --- │
│ date ┆ f64 ┆ i64 │
╞════════════╪════════════╪════════════╡
│ 2024-06-01 ┆ 0.0 ┆ 0 │
│ 2024-06-02 ┆ 0.0 ┆ 1 │
│ 2024-06-03 ┆ 1.0 ┆ 2 │
│ 2024-06-04 ┆ 1.2 ┆ 3 │
└────────────┴────────────┴────────────┘
and keep it stored in a separate df,
columns | first_appearance | last_appearance
column_one | 2024-06-03 | 2024-06-04
column_two | 2024-06-02 | 2024-06-04