Skip to content

Commit

Permalink
fix: Replaced select_series with select_columns to match the new Pola…
Browse files Browse the repository at this point in the history
…rs API break change from v0.44
  • Loading branch information
notCuteSocks committed Jan 14, 2025
1 parent 2dbbe0b commit 8b54612
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Dataset {
}

// Take label from the dataframe:
let label_series = dataframe.select_series([label_column])?[0].cast(&Float32)?;
let label_series = dataframe.select_columns([label_column])?[0].cast(&Float32)?;
if label_series.null_count() != 0 {
return Err(Error::new(
"Can't create a dataset with null values in label array",
Expand All @@ -228,7 +228,7 @@ impl Dataset {
let _ = dataframe.drop_in_place(label_column)?;

let mut label_values = Vec::with_capacity(m);
let label_values_ca = label_series.unpack::<Float32Type>()?;
let label_values_ca = label_series.f32()?;
label_values.extend(label_values_ca.into_no_null_iter());

let mut feature_values = Vec::with_capacity(m * (n - 1));
Expand All @@ -240,7 +240,7 @@ impl Dataset {
}

let series = series.cast(&Float32)?;
let ca = series.unpack::<Float32Type>()?;
let ca = series.f32()?;
feature_values.extend(ca.into_no_null_iter());
}
Self::from_slice(&feature_values, &label_values, (n - 1) as i32, false)
Expand Down

0 comments on commit 8b54612

Please sign in to comment.