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

Function encode_array

crates/openquant/src/microstructural_features.rs:493–501  ·  view source on GitHub ↗
(array: &[f64], encoding: &[(f64, char)])

Source from the content-addressed store, hash-verified

491}
492
493pub fn encode_array(array: &[f64], encoding: &[(f64, char)]) -> String {
494 let mut s = String::new();
495 for v in array {
496 if let Some(c) = find_nearest(encoding, *v) {
497 s.push(c);
498 }
499 }
500 s
501}
502
503fn parse_datetime(s: &str) -> Result<NaiveDateTime, chrono::ParseError> {
504 NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S%.f")

Callers 3

bar_featuresMethod · 0.85
encode_array_f64Function · 0.85
ms_encode_arrayFunction · 0.85

Calls 1

find_nearestFunction · 0.85

Tested by 1

encode_array_f64Function · 0.68