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
......@@ -506,6 +506,10 @@ class Metric1D(BaseReport):
# aggregate the data running dedicated operator for each column
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
......@@ -713,7 +717,14 @@ class Metric2D(BaseReport):
# rotate the data frame when year is along the y-axis
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