How to delete zeros from matrix delete and delete! does not work?
Let’s say you have:
[1 0 1; 0 1 1; 0 0 1]
What do you want the result of “delete zeros” to be?
Just in case you’re talking about sparse matrices, then the functions you’re looking for are
in what packgate is because it doesn;t work?
пон, 28. окт 2019. у 17:13 Jamie via JuliaLang email@example.com је написао/ла:
dropzeros doesn’t work then it won’t be applicable to your case — it only applies to SparseArrays.
Probably what you want is something like
filter(!iszero, A), which will return all nonzero elements as a vector… but you could also reasonably want all rows without any nonzeros, or all rows that aren’t all nonzero, or …, or …
We need a bit more to go on