# Using Map with functions that take a parameter [duplicate]

I have a list

l={{0, 0, 0, 3}, {0, 0, 0, 3}, {0, 0, 1, 2}}


And I would like to obtain the number of zeros in each sublist:

NZ=Table[Count[l[[i]], 0], {i, Length[l]}]


which will return the list: {3,3,2} .

Is there a way to use Map to accomplish this more cleanly?

What I would like to do is write something like: Map[Count, l] which will of course fail because Count needs a pattern to count.

• Also have a look here and here (I am sure there were still more). – Leonid Shifrin Mar 19 '14 at 14:58
• Thanks. Sorry I duplicated previous posts. I searched but it often isn't obvious what to search for. – JEP Mar 20 '14 at 15:07