Counting nonzeros
- To: mathgroup at smc.vnet.net
- Subject: [mg86865] Counting nonzeros
- From: carlos at Colorado.EDU
- Date: Mon, 24 Mar 2008 01:44:20 -0500 (EST)
I want to count the # of NZ entries in an arbitrary multilevel list, say exp, that contains only integers. Is this the easiest way: k = Length[Flatten[exp]]-Count[Flatten[exp],0]
- Follow-Ups:
- Re: Counting nonzeros
- From: "Thomas Dowling" <thomasgdowling@gmail.com>
- Re: Counting nonzeros
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Counting nonzeros