File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545; ; tree-based index is pure overhead — you'd rebuild it constantly. As Chris
4646; ; Nuernberger (author of tech.ml.dataset) put it: "Just sorting the dataset and
4747; ; using binary search will outperform most/all tree structures in this scenario."
48- ; ; (Notably, [Polars](https://pola.rs/) — the Rust-based DataFrame library gaining
49- ; ; traction as a Pandas alternative — reached the same conclusion and has no index
50- ; ; by design.)
48+ ; ; Notably, [Polars](https://pola.rs/) — the Rust-based DataFrame library gaining
49+ ; ; traction as a Pandas alternative — reached the same conclusion. Polars has no
50+ ; ; index by design; you always specify the column explicitly:
51+ ; ;
52+ ; ; ```python
53+ ; ; # Pandas (implicit index)
54+ ; ; df = df.set_index('Time')
55+ ; ; df['2024-01'] # slice via index
56+ ; ; df.resample('D').mean() # resample via index
57+ ; ;
58+ ; ; # Polars (explicit column)
59+ ; ; df.filter(pl.col('Time').dt.year() == 2024, pl.col('Time').dt.month() == 1)
60+ ; ; df.group_by_dynamic('Time', every='1d').agg(pl.col('Demand').mean())
61+ ; ; ```
5162; ;
5263; ; **On convenience:** The index adds implicit state threaded through your data.
5364; ; Tablecloth's API avoids this — you always say which columns you're operating on.
You can’t perform that action at this time.
0 commit comments