I'm trying to window my data frame so I made a for loop as the code below:
m=6
p=0
Window=[]
for i in list2:
l=df3S.iloc[i:i+k,:]
j=df3S.iloc[i+m:i+(3*m),:]
Window.append(l)
Window.append(j)
i+=k
so I have a list of data sets right now but I need a multi-index data frame to do some analysis on it but when I convert it to a data frame by
pd.DataFrame()
it returns me just the empty columns like this:
0
____________________________
0 Date Node Ax Ay Az Gx...
1 Date Node Ax Ay Az G...
2 Date Node Ax Ay Az G...
3 Date Node Ax Ay Az G...
4 Date Node Ax Ay Az G...
... ...
41003 Date Node Ax Ay ...
41004 Date Node Ax Ay ...
41005 Date Node Ax Ay ...
41006 Date Node Ax Ay ...
41007 Date Node Ax Ay ...
I don't know how to fix it this is the output of my list: [1]: https://i.stack.imgur.com/Ek4li.png
I have written the following code to store my for loop in a data frame like this:
k=12
m=6
p=0
Window=pd.DataFrame()
for i in list2:
l=df3S.iloc[i:i+k,:]
j=df3S.iloc[i+m:i+(3*m),:]
Window[str(l)]=l
Window[str(l)]=j
i+=k
but it returns me this error:
ValueError :Cannot set a frame with no defined index and a value that cannot be converted to a Series