I have the following dataframe:
ID mutex add atomic add cas add ys_add blocking ticket queued fifo
Cores
1 21.0 7.1 12.1 9.8 32.2 44.6
2 121.8 40.0 119.2 928.7 7329.9 7460.1
3 160.5 81.5 227.9 1640.9 14371.8 11802.1
4 188.9 115.7 347.6 1945.1 29130.5 15660.1
There is both a column index (ID) and a row index (Cores). When I use DataFrame.to_html(), I get a table like this:
Instead, I'd like a table with a single header row, composed of all the column names (but without the column index name ID) and with the row index name Cores in that same header row, like so:
I'm open to manipulating the dataframe prior to the to_html() call, or adding parameters to the to_html() call, but not messing around with the generated html.


df.drop([0], axis=0)and then usedf.rename{ 'ID' : 'Cores'}df.rename_axis(columns=None )IDdisapears: theCorescell still appears in a separate header row from all the column header, like this.df = df.rename_axis(columns=None)?Coresand the list of column names are still different things entire and even the dataframe text output reflects (it still has cores on a different line from the column headers).