Pandas on Jupyter Notebook VS Code not displaying outputs properly
Question:
Does anyone know how to make Pandas outputs display properly in VS Code Jupyter Notebooks?
As you can see in the image, the values for individual columns in the output of a Pandas DataFrame aren’t aligned (whereas they are aligned if you use Jupyter Notebooks directly on a web browser).
Answers:
I think you’ve got a bracket mismatch. Change your code to this:
df2.loc[df2['Airport'] == 'ATL', ['Delay']]
For the alignment of pandas, I think I have a relatively simple strategy. We can use IPython module.Use the following code to output the results.
from IPython.display import display
display(df2)
Does anyone know how to make Pandas outputs display properly in VS Code Jupyter Notebooks?
As you can see in the image, the values for individual columns in the output of a Pandas DataFrame aren’t aligned (whereas they are aligned if you use Jupyter Notebooks directly on a web browser).
I think you’ve got a bracket mismatch. Change your code to this:
df2.loc[df2['Airport'] == 'ATL', ['Delay']]
For the alignment of pandas, I think I have a relatively simple strategy. We can use IPython module.Use the following code to output the results.
from IPython.display import display
display(df2)