x = ['1', '2', '3', '4']
y = [[1,0],[2,0],[3,0],[4,]]
I want to create a dictionary so the x and y values would correspond like this:
1: [1,0], 2: [2,0]
and etc
You can use zip function:
dict(zip(x, y))
>>> x = ['1', '2', '3', '4']
... y = [[1,0],[2,0],[3,0],[4,]]
>>> dict(zip(x, y))
0: {'1': [1, 0], '2': [2, 0], '3': [3, 0], '4': [4]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With