I have a complex problem at hand to solve. Data is in pandas dataframe and is stored like
sample data
For each value in level3, I have calculated a metric and