0

I have a matrix such as

   COL1 COL2 COL3 COL4 COL5
SP1 0    1    3    0    0
SP2 1    3    0    0    0
SP3 0    0    0    1    0
SP4 0    1    0    1    0
SP4 3    0    0    4    0

And I would like simply to count for each column, the number of SP with non-ero values ?

I should then get something like :

     Nsp
COL1 2
COL2 3
COL3 1
COL4 3
COL5 0

Does someone have an idea please ?

Martin Gal
  • 16,640
  • 5
  • 21
  • 39
chippycentra
  • 3,396
  • 1
  • 6
  • 24

0 Answers0