Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cluster:usage_tips:jupyter [2022/01/07 13:00] – created 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 [[salamander.sleep.ru.is]] (if that doesn't work you can also try [[130.208.209.2]]. You will be greeted | + | In order to access the JupyterHub server, access the [[cluster: |
+ | |||
+ | ==== Adding environment ==== | ||
+ | |||
+ | JupyterHub allows each user to use their own python environments | ||
+ | |||
+ | To create a new python environment we use '' | ||
+ | |||
+ | The command for creating a new conda environment named '' | ||
+ | < | ||
+ | conda create -n myenv | ||
+ | </ | ||
+ | Note the location of the new environment. | ||
+ | |||
+ | To be able to use the environment in jupyterhub you need to install ipykernel to the environment: | ||
+ | |||
+ | < | ||
+ | conda activate myenv | ||
+ | conda install ipykernel | ||
+ | </ | ||
+ | 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/ | ||
+ | </ | ||
+ | |||
+ | To remove the '' | ||
+ | < | ||
+ | jupyter kernelspec uninstall myenv | ||
+ | </ | ||
+ | =====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 / | ||
+ | </ |