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 17:08] – [Installing packages] 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 [[cluster: | + | In order to access the JupyterHub server, access the [[cluster: |
- | + | ||
- | ===== Usage ===== | + | |
- | + | ||
- | + | ||
- | The default JupyterHub interface has 3 python environments installed one python3 environment, | + | |
==== Adding environment ==== | ==== Adding environment ==== | ||
Line 17: | Line 12: | ||
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 26: | 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 ==== | ==== Installing packages ==== | ||
- | To install a package, '' | + | To install a package, '' |
- | '' | + | '' |
- | After the installation, | + | 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 / | ||
+ | </ | ||