How would I count the number of occurrences of some value in a multidimensional array made with nested lists? as in, when looking for \'foobar\' in the following list:
First join the lists together using itertools, then just count each occurrence using the Collections module:
import itertools
from collections import Counter
some_list = [['foobar', 'a', 'b'], ['x', 'c'], ['y', 'd', 'e', 'foobar'], ['z', 'f']]
totals = Counter(i for i in list(itertools.chain.from_iterable(some_list)))
print(totals["foobar"])