I'm looking to count the number of occurrences of an empty array within a 2D array in the most efficient manner. For example :
array = [[a,b],[a,b,c],[a],[],[],[],[]]
The answer I would like to get should be 4
.
How do we get around doing that without using a lengthy for loop process? It shouldn't also use Numpy, just plain simple Python. I tried .count, but I doesn't quite work with empty arrays.