MCPcopy Create free account
hub / github.com/Open-Quant/openquant / sort_ohlcv_df

Function sort_ohlcv_df

crates/openquant/src/data_processing.rs:73–79  ·  view source on GitHub ↗
(df: &DataFrame)

Source from the content-addressed store, hash-verified

71}
72
73fn sort_ohlcv_df(df: &DataFrame) -> Result<DataFrame, String> {
74 df.sort(
75 ["symbol", "ts_us"],
76 SortMultipleOptions::new().with_order_descending_multi([false, false]),
77 )
78 .map_err(|e| format!("polars sort failed: {e}"))
79}
80
81fn micros_to_naive(ts_us: i64) -> Option<NaiveDateTime> {
82 DateTime::<Utc>::from_timestamp_micros(ts_us).map(|dt| dt.naive_utc())

Callers 2

quality_report_dfFunction · 0.85
clean_ohlcv_dfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected