so I have a list which has 6 dicts inside and I would like to write that to a csv file. I have tried a lot of ways to do it but i have been unsuccessful so far. when i try to write it as a list it give me an error when i try to write it as a dict it also give me an error. can anyone point me in the write direction please.
r_vals=
[{'distance':2.35, 'mpg': 3.215, 'power': 45.0},{'distance':214.3, 'mpg': 29.3,'power': 124.0},{'distance':2.35, 'mpg': 3.215, 'power': 45.0},...{'distance':0.35, 'mpg': 45.5, 'power': 156.0}]
or if there is easier way to get it as a dataframe I would like it to look like this
distance mpg power
2.35 3.215 45.0
214.3 29.3 124.0
.
.
0.35 45.5 156
thank you!