Matrix Row manipulation in Breeze using Scala? -


i've densematrix

1  2  3  0   0   0   0    0    0     0  0  0  11  22  33  0    0    0     0  0  0  0   0   0   111  222  333  

i want remove first row , last row 0s

0  0  0  11  22  33  0    0    0     0  0  0  0   0   0   111  222  333  0  0  0  0   0   0   0    0    0    

how achieve in breeze ?

first, gather rows still want:

val subset = matrix(::, 2 3) 

then add zeroes:

val newmatrix = densematrix.horzcat(subset, densematrix.zeros[double](1,9)) 

i might have mixed rows , columns in last line.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -