Jupyter Notebook
Introduction to Jupyter Notebook
A Jupyter Notebook is an open source web application that allows data scientists to create and share documents that include live code, equations, and other multimedia resources.
Use of Jupyter Notebook:
Jupyter notebooks are used for all sorts of data science tasks such as exploratory data analysis (EDA), data cleaning and transformation, data visualization, statistical modeling, machine learning, and deep learning.
Advantage of Using Jupyter Notebook:
- Useful for "showing the work" through a combination of code, markdown, links, and images.
- Jupyter notebooks can also be converted to a number of standard output formats (HTML, PowerPoint, LaTex, PDF, Restructured Text, Markdown, Python)
Working of Jupyter Notebook
Step 1) Open Jupyter Notebook from apps.
step 2) In your default browser a web page will open like this and default directory will be C drive of your system.
Step 3) If you want to run and save your code in other directory then follow these steps:
- Open Anaconda Prompt (anaconda 3) from start menu.
- Type the directory name followed by colon (:) and then press Enter (Example - d:)
- Type Jupyter notebook and then Enter.
Step 4) Open your preferred folder and then click on New -> Python 3.
Step 5) A new notebook will be opened with name 'Untitled.ipynb' and you can run your code here.
Commands and Shortcut of Jupyter Notebooks
Action Menu Keyboard Shortcut
Run selected cells Cell -> Run Cells Ctrl + Enter
Run the current cell and go down, Cell -> Run Cells and Select Below, Shift + Enter
Save and checkpoint File -> Save and Checkpoint Ctrl + S
Insert cell above Insert -> Insert Cell Above A
Insert cell below Insert -> Insert Cell Below B
Change the cell type to Code, Cell -> Cell Type -> Code Y
Change the cell type to Markdown, Cell -> Cell Type -> Markdown, M
Code completion or indent Tab
How to run .py file from Terminal
Steps to Run. py scripts
- Open Spyder from apps installed in your system.
- Write and save code in your preferred directory, it will be saved as .py extension.
- Open Anaconda Command Prompt.
- Go to the directory in which you have saved the .py file using below command cd path_to_directory
- Run your script using below command: Python Scriptname.py
Action | Menu | Keyboard Shortcuts |
Run selected cells | Cell -> Run Cells | Ctrl + Enter |
Run the current cell and go down | Cell -> Run Cells and Select Below | Shift + Enter |
Save and checkpoint | File -> Save and Checkpoint | Ctrl + S |
Insert cell above | Insert -> Insert Cell Above | A |
Insert cell below | Insert -> Insert Cell Below | B |
Change the cell type to Code | Cell -> Cell Type -> Code | Y |
Change the cell type to Markdown | Cell -> Cell Type -> Markdown | M |
Code completion or indent |
| Tab |
Comments
Post a Comment