MCPcopy Create free account
hub / github.com/daniel-e/rustml / from_csv_file

Function from_csv_file

src/csv.rs:102–113  ·  view source on GitHub ↗
(fname: &str, sep: &str)

Source from the content-addressed store, hash-verified

100}
101
102pub fn from_csv_file(fname: &str, sep: &str) -> Result<Matrix<f64>, &'static str> {
103
104 let mut s = String::new();
105
106 try!(
107 try!(
108 File::open(fname).map_err(|_| "Could not open file")
109 )
110 .read_to_string(&mut s).map_err(|_| "Could not read file.")
111 );
112 from_csv_string(&s, sep)
113}
114
115
116#[cfg(test)]

Callers 1

mainFunction · 0.85

Calls 1

from_csv_stringFunction · 0.85

Tested by

no test coverage detected