Why do my pandas dataframe columns always align to the left?


I am very new to Jupyter Notebook.

I believe that pandas aligns data frame columns to the right by default. But in my Jupyter Notebook, it is always left-aligned, which I find a little bit difficult to see numbers and I want to fix it. I didn’t do any setup for pandas or my Jupyter Notebook except changing the theme to dark mode (my setting: t -t onedork -f source -fs 11 -ofs 11 -cellw 88% -T). I would appreciate it if anyone could give me some advice. Thank you!

I couldn’t figure out why it was happening. I tested my Jupyter Notebook on both Chrome and Firefox. It seemed that my theme setting was causing the issue of pandas data frame alignment. So I reset the theme and now it is ok. Thank you.

1 Like