| Crates.io | toraniko-utils |
| lib.rs | toraniko-utils |
| version | 0.2.0 |
| created_at | 2025-12-22 15:23:21.799096+00 |
| updated_at | 2025-12-25 15:46:36.45049+00 |
| description | Data utilities for the toraniko factor model |
| homepage | https://github.com/factordynamics/toraniko-rs |
| repository | https://github.com/factordynamics/toraniko-rs |
| max_upload_size | |
| id | 1999870 |
| size | 54,747 |
Data utilities for the toraniko factor model.
fill_features - Forward-fill null values within partitionssmooth_features - Apply rolling mean smoothingtop_n_by_group - Select top N rows per groupuse toraniko_utils::{fill_features, smooth_features, top_n_by_group};
// Fill nulls in features, sorted by date, partitioned by symbol
let filled = fill_features(df.lazy(), &["price", "volume"], "date", "symbol");
// Smooth features with 5-day rolling mean
let smoothed = smooth_features(df.lazy(), &["price"], "date", "symbol", 5);
// Get top 100 stocks by market cap per date
let top = top_n_by_group(df.lazy(), 100, "market_cap", &["date"], true);