Closed mwouts closed 1 year ago
A simpler example is a dataframe that has a name for the column index, but no name on the row index:
pd.DataFrame({'a':[1]}).rename_axis('columns', axis=1)
The HTML representation of the table looks like this:
Because of the name on the column index, the HTML header of the table has two entries, which is inconsistent with the table data that has just one entry. This causes a problem for itables.show
because that function uses the same HTML header as Pandas, but drops the index when the index is not informative (here it removes the 0).
With
itables==1.3.5
, displaying the following dataframe causes an HTML popup/warning:DataTables warning: table id=a75598ce-5188-4faa-a80e-a0891dad1a25 - Requested unknown parameter '3' for row 0, column 3. For more information about this error, please see http://datatables.net/tn/4
And indeed the data in the table is not right (the content in the rows are shifted to the left)![image](https://user-images.githubusercontent.com/29915202/205465574-bb0576d1-e0ef-4c9d-aff0-aa8539068e7b.png)
vs![image](https://user-images.githubusercontent.com/29915202/205465617-d1d931f3-afbd-4796-8616-4e5bf05af85f.png)