Difference between revisions of "Jupyter"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
*[https://www.dataquest.io/blog/jupyter-notebook-tutorial/ Dataquest.io] has a very good tutorial on how to use Jupyter, the other interface besides Spyder for running Python code. | *[https://www.dataquest.io/blog/jupyter-notebook-tutorial/ Dataquest.io] has a very good tutorial on how to use Jupyter, the other interface besides Spyder for running Python code. | ||
+ | |||
+ | *It looks like the main use of Jupyter is to save Python input and output in a convenient way. A *.py file just has the input. | ||
*When I use Jupyter, search for Jupyter on my computer, launch it, and then do not shut off the black box that will appear along with the app itself (or it will stop working right). | *When I use Jupyter, search for Jupyter on my computer, launch it, and then do not shut off the black box that will appear along with the app itself (or it will stop working right). | ||
Line 8: | Line 10: | ||
import os; | import os; | ||
os.chdir('c:\\Users\\erasmuse\\Downloads\\') | os.chdir('c:\\Users\\erasmuse\\Downloads\\') | ||
+ | %pwd is a Jupyter "magic" command that says the present working directory. | ||
*You don't always have to use the print command to get the value of a new variable to show. This is interactive, a shell not batch. Sort of. Except you do have to keep Running cells. | *You don't always have to use the print command to get the value of a new variable to show. This is interactive, a shell not batch. Sort of. Except you do have to keep Running cells. |
Revision as of 17:51, 31 July 2021
- Dataquest.io has a very good tutorial on how to use Jupyter, the other interface besides Spyder for running Python code.
- It looks like the main use of Jupyter is to save Python input and output in a convenient way. A *.py file just has the input.
- When I use Jupyter, search for Jupyter on my computer, launch it, and then do not shut off the black box that will appear along with the app itself (or it will stop working right).
- To put something into Markdown comment language instead of Python, switch the box at the top of the editor from Code to Markdown.
- Jupyter can be configured in Python to have a non-default home directory. Or, these Python commands are convenient:
import os; os.chdir('c:\\Users\\erasmuse\\Downloads\\') %pwd is a Jupyter "magic" command that says the present working directory.
- You don't always have to use the print command to get the value of a new variable to show. This is interactive, a shell not batch. Sort of. Except you do have to keep Running cells.