I have sparse situation with a lot of zeros, related chat. I want to see only the nonzero things or nonnull things.
Example
Input
hello[ii_, jj_] := If[ii == 1, Return[True], Return[False]] Table[If[hello[ii, jj], {ii, jj} -> 1], {ii, 1, 5}, {jj, 1, 5}]Output
{{{1, 1} -> 1, {1, 2} -> 1, {1, 3} -> 1, {1, 4} -> 1, {1, 5} -> 1}, {Null, Null, Null, Null, Null}, {Null, Null, Null, Null, Null}, {Null, Null, Null, Null, Null}, {Null, Null, Null, Null, Null}}Intended Output
{{1, 1} -> 1, {1, 2} -> 1, {1, 3} -> 1, {1, 4} -> 1, {1, 5} -> 1}
where the full form of the intended output could be a 5x5 matrix with 1st row with ones and otherwise zeros.
SparseArrayandArrayRules. – DavidC Nov 09 '13 at 14:42