Does anyone knows how to create a DenseVector[Double] using Breeze library in scala

43 Views Asked by At

I want to create data that have a form of List[DenseVector[Double]] using scala and Breeze library. The initial data are loaded with json4s, so they have a form of List(Jarray(JDouble) does anyone have any idea ?

1

There are 1 best solutions below

1
Emiliano Martinez On

Yes, you can use this code:

  list
    .map { case JArray(list) => list.map { case JDouble(v) => v } }
    .map(el => DenseVector(el))