0

Is there a way to make a Python dictionary that encloses the lists of values in [] rather than().

keys = ["field1", "field2", "field3"]
values = [[1,2,3], [3,4,5], [6,7,8]]
dictionary = dict(zip(keys, zip(*values)))

gives:

{'field2': (2, 4, 7), 'field1': (1, 3, 6), 'field3': (3, 5, 8)}

What I want is:

{'field2': [2, 4, 7], 'field1': [1, 3, 6], 'field3': [3, 5, 8]}

Thank you!

user3877654
  • 1,045
  • 1
  • 16
  • 40

0 Answers0