I'm reading the book, Python Machine Learning
, and tried to analyze the code. But it offers only *.ipynb
file and it makes me very bothersome.
For example,
In this code, I don't want to run whole In[9]
but want to run line by line so that I can check each value of variable and know what each library function do.
Do I have to comment everytime I want to execute part of codes? I just want something like Execute the block part
like in MATLAB
And also, let say I comment some part of code and execute line by line. How can I check each variable's value without using print()
or display()
? As you know, I don't have to use print()
to check the value in python interactive shell
in terminal. Is there a similar way in Jupyter
?
In Jupyter Notebook or in IPython console, you can configure this behaviour with ast_node_interactivity
:
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
With this config, every single line will be pretty printed, even if they're in the same cell.
None
isn't displayed.
There are many other useful tips here ("28 Jupyter Notebook tips, tricks and shortcuts - Dataquest").
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