I have a dataframe
df = pd.DataFrame(columns = ["AA", "BB", "CC"])
df.loc[0]= ["a", "b", "c1"]
df.loc[1]= ["a", "b", "c2"]
df.loc[2]= ["a", "b", "c3"]
I need to add secod row to header
df.columns = pd.MultiIndex.from_tuples(zip(df.columns, ["DD", "EE", "FF"]))
my df is now
AA BB CC
DD EE FF
0 a b c1
1 a b c2
2 a b c3
but when I write this dataframe to csv file
df.to_csv("test.csv", index = False)
I get one more row than expected
AA,BB,CC
DD,EE,FF
,,
a,b,c1
a,b,c2
a,b,c3