How to do count for sub list?????
- To: mathgroup at smc.vnet.net
- Subject: [mg82095] How to do count for sub list?????
- From: wangzhen0829 at gmail.com
- Date: Fri, 12 Oct 2007 02:50:56 -0400 (EDT)
Hallo, everyone I am new to Mathematica, and now I have a problem with it, hope to get some help from here. I have a {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1}, {1, 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, 0, 0, 1, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0}} I need to get a list which represent the number of NON-zero number in each sublist. I should get a list like: {0,0,1,1,0,0,1,1} Thank you!
- Follow-Ups:
- Re: How to do count for sub list?????
- From: "Ricardo Samad" <resamad@gmail.com>
- Re: How to do count for sub list?????