Yes: see dropzeros
:
julia> a=sparse([1],[1],[0])
1Γ1 SparseMatrixCSC{Int64,Int64} with 1 stored entry:
[1, 1] = 0
julia> dropzeros(a)
1Γ1 SparseMatrixCSC{Int64,Int64} with 0 stored entries
Or you can do it in-place (change a
) with dropzeros!
.
source
to share