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

Function parse_datetime

crates/openquant/src/microstructural_features.rs:503–508  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

501 return Err(MicrostructuralError::NanInArray);
502 }
503 let table = ascii_table();
504 let alphabet = &table[..num_letters];
505 let mut sorted = array.to_vec();
506 sorted.sort_by(f64::total_cmp);
507 let mut out: Vec<(f64, char)> = Vec::new();
508 for (q, letter) in linspace(0.01, 1.0, alphabet.len()).iter().zip(alphabet.iter()) {
509 let idx = ((*q) * (sorted.len() as f64 - 1.0)).round() as usize;
510 out.push((sorted[idx], *letter));
511 }

Callers 2

new_from_csvMethod · 0.85
get_features_from_csvMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected