i have a dictionary with key value but values are in array,
i want to convert the array into value for each keys
#this is my dictionay
input_dic = {
'pm_25': [22.5, 23.8, 24.9],
'pm_10': [2.76, 6.76, 2.76],
'humidity': [55, 10, 85],
'temprature': [12.7, 41.1, 85.1]
}
# i want like this
want_to = [
{'pm_25': 22.5, 'pm_10': 2.76, 'humidity': 55, 'temprature': 12.7},
{'pm_25': 23.8, 'pm_10': 6.76, 'humidity': 10, 'temprature': 41.1},
{'pm_25': 24.9, 'pm_10': 2.76, 'humidity': 85, 'temprature': 85.1},
]
please any one know how to convert this
>Solution :
[dict(zip(input_dic, values))
for values in zip(*input_dic.values())]