I'm trying to display 2 output of 2 lines in the same time, I use Panda library and it seems like it display only the output of second line:
import pandas as pd
data = {"state": ["Ohio", "Ohio", "Ohio", "Nevada", "Nevada"],
"year": [2000, 2001, 2002, 2001, 2002],
"pop": [1.5, 1.7, 3.6, 2.4, 2.9]}
frame = pd.DataFrame(data)
this is My cell:
frame.state
frame.year
and this is the outputs:
Use the following smart shortcuts to quickly run the code cells: Ctrl+Enter : Runs the current cell. Shift+Enter : Runs the current cell and select the cell below it. To execute all code cells in your notebook, click. on the notebook toolbar or press Ctrl+Alt+Shift+Enter .
Capturing Output With %%capture IPython has a cell magic, %%capture , which captures the stdout/stderr of a cell. With this magic you can discard these streams or store them in a variable. By default, %%capture discards these streams. This is a simple way to suppress unwanted output.
We can run different tasks or processes simultaneously by using multiple computing resources during parallel notebook executions.
You can run a cell with this at the beginning of the notebook:
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
This will run all the expressions in each cell. If you want to return to the default behavior, you can write:
InteractiveShell.ast_node_interactivity = "last_expr"
If you want to provide two outputs at the same time you can try doing it this way. type this on your jupyter notebook cell,
frame.state , frame.year
Just insert a comma in between it will print Output for both the statements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With