Commit e5ce9cfe authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

in Metric1D and 2D, rwqeduce MutliIndex to Index for the pseudo field year.

parent 204e76f5
......@@ -507,6 +507,10 @@ class Metric1D(BaseReport):
df = df.groupby(index_groupby)
df = df.agg(operators)
# transform year MultiIndex into Index (only for year pseudo field)
if config.group_field == 'year':
df.index = [el[1] for el in df.index]
# the data frame is persistent
self.df = df
......@@ -714,6 +718,13 @@ class Metric2D(BaseReport):
if config.group_field_y == 'year':
df = df.T
# transform year MultiIndex into Index (only for year pseudo field)
if config.group_field_x == 'year':
df.columns = [el[1] for el in df.columns]
elif config.group_field_y == 'year':
df.index = [el[1] for el in df.index]
# data frame is persistent
self.df = df
......
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