use matten_data::Table;
fn main() -> Result<(), matten_data::MattenDataError> {
let csv = "\
region,sales,cost,quantity
north,100,40,5
south,150,,7
east,120,55,6";
let table = Table::from_csv_str(csv)?;
println!("{}", table.schema_summary());
let tensor = table
.select_columns(["sales", "cost", "quantity"])?
.fill_missing(0.0)?
.try_numeric()?
.to_tensor()?;
println!("tensor shape: {:?}", tensor.shape());
println!("tensor data : {:?}", tensor.as_slice());
assert_eq!(tensor.shape(), &[3, 3]);
Ok(())
}