Patching Dec 9, 2021 6-7a CST- All GitLab services may be unavailable for 5-10 minutes

Commit 8c155bed authored by Matthew Krafczyk's avatar Matthew Krafczyk
Browse files

Solve weird issue with pandas multi-index.

parent 28bbf566
......@@ -24,6 +24,7 @@ def sequence_plain_df(df, num_before, num_after, inc_val=True):
# Build segments
segments = []
columns = df.columns
for i in range(num_before,-num_after-1,-1):
segment = None
if i == 0:
......@@ -33,7 +34,7 @@ def sequence_plain_df(df, num_before, num_after, inc_val=True):
segment = df.shift(i)
if segment is not None:
segment.columns = pd.MultiIndex.from_product([df.columns,[-i]])
segment.columns = pd.MultiIndex.from_product([columns,[-i]])
segments.append(segment)
# Join segments into full dataframe.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment