0

Does someone knows why x = df.select(["A"]).unwrap().to_ndarray::<Float64Type>().unwrap() is considered as a 2d array while I want it to be 1d array? Is there a function to reshape it to 1d array? Here the shape of y is (100, 1). The type of x is a ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>

Simson
  • 3,373
  • 2
  • 24
  • 38
Arli94
  • 680
  • 2
  • 8
  • 19

1 Answers1

0

You Select a list of columns, the list having length 1. If the row count is say 100, then your resulting 2D-array has dimension (100, 1).

Wolfgang Kuehn
  • 12,206
  • 2
  • 33
  • 46