This is a really basic question but I haven't been able to find an answer:
In Jupyter, if I execute two pandas df.describe()
calls in the same cell, only the last one's output is displayed. The same is true for .info()
, .head()
etc. etc.
How do I persuade Jupyter and pandas to display all N
of the above outputs sequentially as intended, with the same tabular formatting that is the default for a single output?
FWIW example code would be:
df1.describe()
#...
df2.describe()
dfN.describe() # Only the result of the final call is displayed
Points from comments addressed:
print(df1.describe())
works, but does not render the table identically to how it is rendered by describe()
itself.
Displaying two pandas tables side-by-side (Jupyter notebook display two pandas tables side by side) may work, but doesn't scale to N
tables.
You can configure your current session and specify what values to show by InteractiveShell.ast_node_interactivity:
%config InteractiveShell.ast_node_interactivity = 'all'