-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update jupyter and add how to run with pycharm
- Loading branch information
1 parent
a95b61e
commit a5fc354
Showing
4 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,58 @@ | ||
|
||
# Jupyter Lab & Notebooks | ||
|
||
If you are working with Python, a great way to develop your code efficiently, especially when performing data analysis or creating POCs, is to use Jupyter notebooks. Here we are showing you how to do this through Jupyter lab, which is a web-based, interactive development environment that includes Jupyter notebooks. | ||
If you are working with Python, a great way to develop your code efficiently, especially when performing data analysis or creating proof-of-concepts, is to use [Jupyter notebooks](https://jupyter.org/). | ||
Here we are showing you how to do this through Jupyter lab, which is a web-based, interactive development environment that includes Jupyter notebooks. | ||
|
||
|
||
# How to install: | ||
|
||
In your terminal/Powershell you can use `pip` to install Jupyter Lab. | ||
# How to install & launch | ||
|
||
```bash | ||
pip install jupyterlab | ||
``` | ||
=== "Using the terminal" | ||
In your [terminal](../computer/terminal.md), you can use `pip` to install Jupyter Lab packages. | ||
|
||
# How to launch: | ||
```bash | ||
pip install jupyterlab | ||
``` | ||
|
||
Then you can launch the application with: | ||
Then you can launch the application with: | ||
|
||
```bash | ||
jupyter lab | ||
``` | ||
```bash | ||
jupyter lab | ||
``` | ||
|
||
This will start Jupyter Lab on your browser. On the left panel you can navigate through your files and directories. The right panel is the Launcher; from here you can start a notebook, as shown below. | ||
This will start Jupyter Lab in your internet browser (eg Firefox/Chrome/Safari). | ||
On the left panel you can navigate through your files and directories. The right panel is the Launcher; from here you can start a notebook, as shown below. | ||
|
||
![Interface](img/jupyter-1.png) | ||
![Interface](img/jupyter-1.png) | ||
|
||
# How to work with a notebook | ||
|
||
Within the new notebook, you can write small blocks of code in separate cells and run them individually by pressing `SHIFT+ENTER`. You can move cells around and collapse them, plot graphs and images and you can even add [Markdown](../../docs/writing/markdown.md) cells to document your process. | ||
=== "Using PyCharm" | ||
|
||
!!! warning | ||
This does **not** not with the free version of PyCharm (Community Edition). | ||
You need the [Professional Edition](https://www.jetbrains.com/pycharm/) (free for students). | ||
|
||
In PyCharm, open a project where you have one or more `*.ipynb` files and then install "jupyterlab" and "jupyter" packages: | ||
|
||
![](img/jupyter-pycharm-install.png){:width="500px"} | ||
|
||
and then you can simply run press Run/Play to run the cell that is currently selected, and you can select the one you want with the mouse. | ||
|
||
![](img/jupyter-pycharm-run.png) | ||
|
||
|
||
## How to work with a notebook | ||
|
||
Within the new notebook, you can write small blocks of code in separate cells and run them individually by pressing `SHIFT+ENTER`. You can move cells around and collapse them, plot graphs and images and you can even add [Markdown](../writing/markdown.md) cells to document your process. | ||
|
||
![Interface](img/jupyter-2.png) | ||
|
||
The biggest advantage of the notebook is that you do not need to rerun parts of code that might be time-consuming (eg loading a large TIF file). Once a cell is run, its state is preserved and subsequent cells can be changed and run independently. | ||
|
||
As shown below, you can use a exclamation mark to run Bash commands (for example for installing a new python module to your environment) and a question mark to see some information about you functions an variables. | ||
!!! info | ||
The biggest advantage of the notebook is that you do not need to rerun parts of code that might be time-consuming (eg loading a large TIF file). Once a cell is run, its state is preserved and subsequent cells can be changed and run independently. | ||
|
||
As shown below, you can use a exclamation mark to run bash commands (for example for installing a new python module to your environment) and a question mark to see some information about you functions an variables. | ||
|
||
![Tips](img/jupyter-3.png) |