Is it possible to hide the index when displaying pandas dataframes, so that only the column names appear at the top of the table?
This would need to work for both the html representation in ipython notebook and to_latex() function (which I'm using with nbconvert).
Ta.
Set
index=False
For ipython notebook:
For to_latex:
Set
index=False
.E.g:
DataFrame.to_csv("filename", index=False)
This will work.
As has been pointed out by @waitingkuo, index=False is what you need. If you want to keep the nice table layout within your ipython notebook, you can use:
I added the following cell to my notebook which works fine in Jupyter 4.0.2.
Note: It removes the first column of 'any' table even when there is no index.