Reputation: 11
For some reason, whenever I create a dataframe in pandas from reading in data from a file, I don't have gridlines:
I have checked my settings for pd.options for all display attributes and everything was set to the default. Can anyone help me change the formatting of my dataframe? This format happens even when I open new python notebooks within jupyter notebook.
Upvotes: 1
Views: 3376
Reputation: 4645
Add this and run from a cell
%%HTML
<style type="text/css">
table.dataframe td, table.dataframe th {
border: 1px black solid !important;
color: black !important;
}
Use df
instead of print(df)
Source: answer by MEdwin here Python Jupyter Notebook print dataframe borders
Upvotes: 1