When I zip 2 list to create a python dict, only a k,v is returnd, but my 2 lists have length = 5.
my lists look like this:
Date_List = ['2019-11-04', '2019-11-04', '2019-11-04', '2019-11-04', '2019-11-04']
Gains_List = [0.0, -0.16873767942313656, 0.7362161773647236, -0.13807995856330857, 0.2844974266425382]
The length of both is equal, so, I try to create a dict using dict comprehension:
accumulated = {k: v for k, v in zip(new_data_list, ganhos)}
But, when I print accumulated the return is only one values like:
{'2019-11-04': 0.2844974266425382}
Another thing that happens is that da date '2019-11-04' have values 0.00 but when I zip, the dict get the last value in Gains_List and put in like first value in the dict.
The result should be look like this:
{2019-11-04: 0.000000, 2019-11-05: -0.168738, 2019-11-06: 0.736216, 2019-11-07: -0.138080, 2019-11-08: 0.284497}