1

For some reason, whenever I create a dataframe in pandas from reading in data from a file, I don't have gridlines:

my_dataframe_display

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.

1
  • Did you try updating your JuPyter as suggested on this similar post? Commented Sep 20, 2018 at 21:44

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.