json - How to convert a line delimited array file to dictionary using Python? -


i have file of format as:

 ["a","b","c","d","e"]  ["1",false,null,"3","hi"]  ["2",true,"7676","2","hello"]  ...  ["3",true,"222","4","bye"] 

i want of following format:

 {"a":"1", "b":false,"c":null,"d":"3","e":"hi"}  {"a":"2", "b":true,"c":"7676","d":"2","e":"hello"}  ...  {"a":"3", "b":true,"c":"222","d":"4","e":"bye"} 

head = ["a","b","c","d","e"] l1 = ["1",false,none,"3","hi"] l2 = ["2",true,"7676","2","hello"] l3 = ["3",true,"222","4","bye"] dict1 = {} dict2 = {} dict3 = {} in range(len(head)):     dict1[head[i]] = l1[i]     dict2[head[i]] = l2[i]     dict3[head[i]] = l3[i] 

Comments