I have an operation that outputs the list
{1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21,
22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 0}
I want it only to output the numbers greater than 0, is there a command or a short code to do this? I haven't been able to do it. Any suggestions are greatly appreciated.
Select[Positive] @ list. – Kuba Jun 09 '16 at 09:07Cases[lst, x_ /; x > 0]– Nasser Jun 09 '16 at 09:09SparseArray[list]["NonzeroValues"]– yode Jun 09 '16 at 09:35