Skip to content

Commit e4dd3ba

Browse files
committed
fix loading of CSV if text or whitespaces are in dataset
1 parent 270b296 commit e4dd3ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn open_from_csv(
5757
// Parse the remaining columns and populate the dataset
5858
for (i, value) in record.iter().skip(1).enumerate() {
5959
if let Some(dataset_column) = data.dataset.get_mut(i) {
60-
dataset_column.push(value.parse()?);
60+
dataset_column.push(value.trim().parse().unwrap_or(0.0));
6161
} else {
6262
return Err("Unexpected number of data columns in the CSV".into());
6363
}

0 commit comments

Comments
 (0)