Commit ad94d02a authored by Matthew Krafczyk's avatar Matthew Krafczyk
Browse files

Make a conditional expression clearer

parent e09a2747
......@@ -231,7 +231,7 @@ def sequence_df(df, lags, group_specs):
# We need to mitigate this by detecting if both by and level are non-zero and if so, transition the level values
# to columns and add them to by.
if level is not None and by is not None:
if (level is not None) and (by is not None):
for lvl in level:
lvl_idx = df.index.names.index(lvl)
lvl_vals = df.index.to_series().apply(lambda t: t[lvl_idx])
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