I have three arrays:
a = ['a', 'b', 'c']
b = [100, 200, 300]
c = [10.2, 20.2, 30.2]
How can i convert to below form in python?
result = {
['a', 100, 10.2],
['b', 200, 20.2],
['c', 300, 30.2]
}
I have three arrays:
a = ['a', 'b', 'c']
b = [100, 200, 300]
c = [10.2, 20.2, 30.2]
How can i convert to below form in python?
result = {
['a', 100, 10.2],
['b', 200, 20.2],
['c', 300, 30.2]
}
You can do it using zip.
In [1]: a = ['a', 'b', 'c']
...: b = [100, 200, 300]
...: c = [10.2, 20.2, 30.2]
In [3]: list(zip(a,b,c))
Out[3]: [('a', 100, 10.2), ('b', 200, 20.2), ('c', 300, 30.2)]