score:33

Accepted answer
In [199]: df2.reset_index().to_dict(orient='list')
Out[199]: 
{'date': ['2014-10-1', '2014-10-2', '2014-10-3', '2014-10-4', '2014-10-5'],
 'foo': [8, 1, 8, 8, 1],
 'temp': [10, 10, 8, 3, 10],
 'time': [1, 2, 3, 4, 5]}

score:0

to create a list of the dictionaries per line

post_data_list = []
for i in df2.index:
  data_dict = {}
  for column in df2.columns:
    data_dict[column] = df2[column][i]
  post_data_list.append(data_dict)

Related Query

More Query from same tag