Filtering matrix with a bit vector doesn't work

78 views
Skip to first unread message

Daniel Korzekwa

unread,
Mar 3, 2016, 11:07:08 AM3/3/16
to Scala Breeze
val v = DenseVector(1d, 2d, 3d)
val filteredV = v(v :> 2d) //works fine
    
val d = DenseMatrix(1d,2d,3d)
val filteredD = d(d(::,0) :>2d,::) //compilation error

The use case here is to filter matrix by some column. Currently, first I use findAll on a particular column and then I filter matrix like this(see below), but the above would be more compact.

val idx = d.filterAll(x => x>2)
d(idx,::)

Ideally I would like to filter matrix by row like this: 
m.filterByRow(row => ....)

also getting matrix iterator with index like m.mapPair((index,row) => ....) would be useful

David Hall

unread,
Mar 5, 2016, 12:35:44 AM3/5/16
to scala-...@googlegroups.com
please open an issue on github

--
You received this message because you are subscribed to the Google Groups "Scala Breeze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-breeze...@googlegroups.com.
To post to this group, send email to scala-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-breeze/b998d15c-bb96-4077-b40b-9a13e34187f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Korzekwa

unread,
Mar 7, 2016, 6:20:08 AM3/7/16
to Scala Breeze
Reply all
Reply to author
Forward
0 new messages