I would like to compact this syntax to avoid double dictionaries comprehensions (I hope to gain some computing time)
d1 = {loc:list(np.sum(data, 0)) for loc, data in dicos.items()}
d2 = {loc:np.nancumsum(list(np.sum(data, 0))) for loc, data in dicos.items()}
I have tried this without success
d1,d2 = [{loc:list(np.sum(data, 0)),loc:np.nancumsum(list(np.sum(data, 0)))} \
for loc, data in dicos.items()]
I don't understand our community's recent obsession with trying to shove more and more functionality into a single comprehension. Not only is the result usually no more efficient than using visible loops, the code can definitely be much less readable when done as a single, complex comprehension. I think what people don't understand is that the loop still exists in much the same form either way...it's just that it's hidden from you inside the Python library code if you use a comprehension.
Here's a clean, readable way to do what you want where you only make a single pass over your data, you build the two dictionaries, and it's very clear what you're doing:
d1 = {}
d2 = {}
for loc, data in dicos.items():
d1[loc] = list(np.sum(data, 0))
d2[loc] = np.nancumsum(list(np.sum(data, 0)))