dict comprehension python3 code example
Example 1: dictionary comprehension python
print({i:j for i,j in zip(txt_list,num) if i!="All"})
Example 2: dict comprehension python
keys=['var1','var2','var3']
my_dict={key:np.zeros(10) for key in keys}
print({i:j for i,j in zip(txt_list,num) if i!="All"})
keys=['var1','var2','var3']
my_dict={key:np.zeros(10) for key in keys}