Function rustml::csv::matrix_to_csv [] [src]

pub fn matrix_to_csv<T: Display + Clone>(m: &Matrix<T>, sep: &str) -> String

Converts a matrix into a comma seperated list of values.

As delimiter between the columns the string sep is used. As delimiter between the rows a newline is used.

Example

use rustml::*;
use rustml::csv::matrix_to_csv;

let m = mat![1.0, 2.0; 3.0, 4.0];
assert_eq!(matrix_to_csv(&m, ","), "1,2\n3,4\n")