Pivot table with python in Workflows and multiple values

I'm trying to bring in data via a SQL query (from Snowflake), then manipulate it in python via the Workflows feature.

I can make a pivot table work with one value:

But when trying with multiple values, it doesn't work:

I know it works:

But I suspect it has something to do with the indices still being multiple.

What can I do to make this work?


Ah HA!

This works, but I'm not sure if it's best. Let me know if y'all have a different/better solution, please:

I'm using this:

col_level_0 = list(the_df.columns.get_level_values(0))
col_level_1 = list(the_df.columns.get_level_values(1))
the_df.columns = [i + " - " + j for i, j in list(zip(col_level_0, col_level_1))]
the_df = the_df.reset_index()