Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在python中,如果我想从矩阵A中设置负数,我可以这样做:
A = np.max(A, 0)
Scala中有类似的方法吗?我有一个 Breeze DenseMatrix 类型的矩阵。
breeze.linalg.max(A, 0.0)
(使用 0.0 而不是 0 很重要,因为 Breeze 不会自动提升标量类型。)