I have RDD[(BreezeMatrix[Double], Array[Int])] and i want to delete the columns of the Matrix that are in the array.
E.g if Array[1, 3, 4], I want to delete 1, 3, 4 columns from the Matrix.
My code is:
val viol = rdd.map(x => for (p <- x._2) {val c = x._1.delete(p, Axis._0)})
But for start i get Unit as return type, even if i return the matrix.
Additionally, i was wondering if there is a more functional way to do it in scala.
Unitbecausex._1.delete(...)does return it. Anyhow let me remind you that may not be a good idea to update an object while you are iterating it.