I have this array of arrays in python.
staff = [
['staff1', '2/18/1998', 21.63],
['staff2', '7/7/1999', 15.87],
['staff3', '8/26/2004', 123.46],
]
I have this array which specify the columns.
out_columns = ['Name','Date','Profit']
Based on these 2 arrays, I would like to convert them into an array of dictionaries that look like this;
dict_arr = [
{"Name":"staff1",
"Date":"2/18/1998",
"Profit":21.63
},
{"Name": "staff2",
"Date": "7/7/1999",
"Profit": 15.87
},
{"Name": "staff3",
"Date": "8/26/2004",
"Profit": 123.46
},
]
I am using python v3.6