I have a dataframe that is the result of a pivot table that has columns:
(best buy, count) 753 non-null values
(best buy, mean) 753 non-null values
(best buy, min) 753 non-null values
(best buy, max) 753 non-null values
(best buy, std) 750 non-null values
(amazon, count) 662 non-null values
(amazon, mean) 662 non-null values
(amazon, min) 662 non-null values
(amazon, max) 662 non-null values
(amazon, std) 661 non-null values
If I send this to a csv file I end up with something that looks like this (truncated)
(best buy, count) (best buy, mean) (best buy, max)
laptop 5 10 12
tv 10 23 34
and so on and so forth.
Is there a way for me to manipulate the dataframe so that the csv that is created instead looks like the below?
best buy best buy best buy
count mean max
laptop 5 10 12
tv 10 23 34