I am new to Python and I am trying to learn manipulating a dictionary. I have a dict that has the following structure:
dict = {'city1':([1990, 1991, 1992, 1993],[1.5,1.6,1.7,1.8]),
'city2':([1993, 1995, 1997, 1999],[2.5,3.6,4.7,5.8])
I would like convert the key of in the following way
'city': ([1990, 1.5],[1991, 1.6],[1992,1.7],[1993,1.8])
I tried using a for loop to loop through the values and create a new value for each key. However, this seems really slow and clumsy. Is there any Pathonic way of achieving this goal?
Thanks!