Horje
convert 2 lists into dictionary Code Example
create dictionary python from two lists
>>> keys = ['a', 'b', 'c']
>>> values = [1, 2, 3]
>>> dictionary = dict(zip(keys, values))
>>> print(dictionary)
{'a': 1, 'b': 2, 'c': 3}
convert 2 lists into dictionary
# convert 2 list into dictionary
a = ['gsw','lakers','clippers']
b = [1,2,3]
my_dict = dict(zip(a,b))
print(my_dict)					# {'gsw': 1, 'lakers': 2, 'clippers': 3}




Python

Related
random.randint(0 1) Code Example random.randint(0 1) Code Example
pandas print a single row Code Example pandas print a single row Code Example
h2o ai python Code Example h2o ai python Code Example
updating file multiple times in pandas Code Example updating file multiple times in pandas Code Example
create panda DataFrame Code Example create panda DataFrame Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7