2016-07-06 79 views

回答

1

我觉得是这样的:

val mat = DenseMatrix(("Solid", "liquid", "gas"), ("Stone", "Water", "Oxygen"), ("Gold", "kerosene", "Nitrogen")) 

{ 
    for { 
    i <- 0 until mat.rows 
    } yield (mat(i, 0) -> mat(i, 1 until mat.cols)) 
} toMap 
相关问题