我使用Breeze库进行Scala中的矩阵操作。一切看起来不错,但它不能在编译时发现的隐式:Scala微风隐式CanMapValues
could not find implicit value for parameter bf: breeze.linalg.support.CanMapValues[breeze.linalg.Matrix[Int],Int,Double,That]
有问题的功能是这样的:
import breeze.linalg._ // this is the only import
def writeMatrixToCsv(path: String, matrix: Matrix[Int]) = csvwrite(new File(path), matrix.mapValues(_.toDouble), separator = ',')
我不知道如何进行 - 我在微风中寻找默认CanMapValues代码,但无法找到它。我该如何解决这个问题?谢谢!
你使用任何进口呢?这是什么csvwrite? – michaJlS
嘿@michaJlS,csvwrite是Breeze方法(请参阅https://github.com/scalanlp/breeze/wiki/Linear-Algebra-Cheat-Sheet)。我在问题中添加了我的导入。问题出在.mapValues中。 – ticofab