You can create a multidimensional dictionary of any type like this:
from collections import defaultdict
from collections import Counter
def multi_dimensions(n, type):
""" Creates an n-dimension dictionary where the n-th dimension is of type 'type'
"""
if n<=1:
return type()
return defaultdict(lambda:multi_dimensions(n-1, type))
>>> m = multi_dimensions(5, Counter)
>>> m['d1']['d2']['d3']['d4']
Counter()