Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| cluster:usage_tips:jupyter [2022/01/07 16:39] – benedikt | cluster:usage_tips:jupyter [2023/03/16 08:48] (current) – [Jupyter] lukab | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Jupyter ====== | ====== Jupyter ====== | ||
| Jupyter is a notebook-based development platform for Python projects, widely used in machine learning projects. | Jupyter is a notebook-based development platform for Python projects, widely used in machine learning projects. | ||
| - | JuypyterHub is a service that provides Jypyter notebooks for users on a given machine. Currently, one jupyterHub server is accessible for Sleep Revolution researchers on the computing hub Salamander. | + | JuypyterHub is a service that provides Jypyter notebooks for users on a given machine. Currently, one jupyterHub server is accessible for Sleep Revolution researchers on the computing hub Dunwich. |
| ===== Access ===== | ===== Access ===== | ||
| - | In order to access the JupyterHub server, access the VPN, and navigate to [[http://salamander.sleep.ru.is|salamander.sleep.ru.is]] (if that doesn' | + | In order to access the JupyterHub server, access the [[cluster: |
| - | ===== Usage ===== | + | ==== Adding environment |
| - | The default JupyterHub interface has 3 python environments installed one python3 environment, | + | |
| + | JupyterHub allows each user to use their own python environments if the default ones have missing packages. | ||
| To create a new python environment we use '' | To create a new python environment we use '' | ||
| - | The command for creating a new conda environment named '' | + | The command for creating a new conda environment named '' |
| < | < | ||
| - | conda create -n aardvark | + | conda create -n myenv |
| </ | </ | ||
| Note the location of the new environment. | Note the location of the new environment. | ||
| Line 20: | Line 21: | ||
| < | < | ||
| - | conda activate | + | conda activate |
| conda install ipykernel | conda install ipykernel | ||
| </ | </ | ||
| - | Finally, to register the environment with jupyterhub, type the command, replacing '' | + | Finally, to register the environment with jupyterhub, type the command, replacing '' |
| + | |||
| + | You also need to replace the path to your environment with by replacing " | ||
| < | < | ||
| - | .conda/path/to/ | + | .conda/envs/myenv/bin/python3 |
| </ | </ | ||
| - | To remove the '' | + | To remove the '' |
| < | < | ||
| - | jupyter kernelspec uninstall | + | jupyter kernelspec uninstall |
| </ | </ | ||
| + | =====Working in Jupyter Notebooks===== | ||
| + | |||
| + | Now you are ready to create your own Jupyter Notebook. Click the blue plus button in the main screen and select an environment, | ||
| + | |||
| + | ==== Installing packages ==== | ||
| + | |||
| + | To install a package, '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | After the installation, | ||
| + | |||
| + | ====Access Data===== | ||
| + | |||
| + | The path to access data from the sleep database always starts with /// | ||
| + | |||
| + | **EXAMPLE: | ||
| + | If the name of your data set is " | ||
| + | |||
| + | < | ||
| + | pd.read_csv("/ | ||
| + | </ | ||
| + | |||
| + | In oder to explore the structure of the folder you are trying to access use the terminal to show the contents of the folder: | ||
| + | |||
| + | < | ||
| + | ls / | ||
| + | </ | ||
| + | |||