I have the following data structure (called df
):
x Fx Fxcum
0 -1.192809 0.888734 0.888734
1 -1.182809 0.483803 1.372537
2 -1.172809 -0.318153 1.054384
3 -1.162809 -0.966345 0.088038
4 -1.152809 -1.512387 -1.424349
The titles x
, Fx
, and Fxcum
are dynamic. If I apply the function tolist()
:
dict(y=df['x'].tolist())
I get:
{'x': [-1.192809,
-1.182809,
-1.172809,
-1.162809,
-1.152809]}
First of all I need to read the titles that are not always x
, Fx
, and Fxcum
and get the following list:
{'x': [-1.192809,
-1.182809,
-1.172809,
-1.162809,
-1.152809],
'Fx': [-1.192809,
-1.182809,
-1.172809,
-1.162809,
-1.152809],
'Fxcum': [-1.192809,
-1.182809,
-1.172809,
-1.162809,
-1.152809]}
Can you point me in the right direction. Do I need to create a loop or are there some libraries that can help me out?