Spyder is a nice programming GUI (graphical user interface) similar to R Studio, if you are familiar with it. You will need to:
- Download data and code for each class. Go to the repository and click on download > zip (top right). Unzip locally somewhere you know (e.g., desktop). Keep in mind you will need to download again for each class, as new contents are added.
- Install Anaconda. Anaconda is a Python distribution with many packages, some we will use. Pick the graphical installer, Python 3.7, for whatever OS (operating system) you are using.
- Launch Anaconda Navigator. (do this step only once) On the left side pane, you will see Home and Enviroments. Click on Enviroments, and using base (root, the default one), click on Channels > Add... >
conda-forge
. This will add a new channel for some packages we will need. Install the packagespyder-notebook
from the forge. - Go to Home and launch Spyder.
- At the bottom, you will see two options: Editor and Notebook. Click on Notebook. Right click on the Welcome page and open the notebooks you have downloaded at step 1.
- Alternatively, skip steps 3-5 and launch Jupyter Notebook via the Anaconda Navigator. Go to the course contents folder and start the notebooks you need.
- You are now good to go and can save locally too.
Binder allows you to run notebooks in the cloud. Just click on launch Binder in the repo. Remember to download any file you edited and want to preserve.
This set-up allows to control code and Python at a lower level. For the purpose of the course, this is not needed nor recommended. You will need:
- A rudimentary understanding of the terminal. The terminal is just an interface to execute commands in an operating system (most often, your local one).
- A rudimentary understanding of git and GitHub. git is a program to version code, i.e. it allows you to keep track of different versions of your code. See here for a tutorial. GitHub is instead an online service provided by a company, now part of Microsoft, which allows you to have multiple code repositories and interact with them via git.
- Conda. Conda is a cross platform package and environment manager that installs and manages conda packages from the Anaconda repository as well as from the Anaconda Cloud. Which means you will be able to a) create Python environments and b) install packages into them. Some packages we will use might not be in the Anaconda Cloud, in that case you can rollback to using
pip install
. You can use your main Python installation if you like, but I recommend using conda to keep experiments separated from the OS. - Jupyter notebooks, a package which allows you to run a web server and have interactive notebooks in it.
- A text editor to write code when not using notebooks. If you don't already have a preferred one, check Sublime Text or Atom.
For Mac OS and Linux (mostly):
ls
list folder contentscd PATH
move current working directory to the PATH location.cd ~
for your home foldercd ..
goes up one level in the folder structuretouch fun.py
creates an empty file namedfun.py
mv fun.py stuff/
movesfun/py
to thestuff
folder, if it exists. If it doesn,mkdir stuff
For more, see here.
For Windows, see here.
- The first time, clone the repository locally using
git clone https://github.com/Giovanni1085/AUC_TMCI_2019.git
. - Keep getting updates to the code before every lab by going to your local repository directory (e.g.,
cd PATH_TO_REPO
) andgit pull
. This will pull all remote changes to local, and update your repository.
You might want to use the GitHub Desktop app to keep track of your repositories. If you have it installed, instead of cloning the repo you can use the Open in Desktop option.
Just download the repository code before every lab, by clicking on Clone or download
, and then Download ZIP
. You will then need to unzip the downloaded file.
IMPORTANT: Either way, this copy of the course repo will conflict with any change you made yourself to the files in there. This is especially the case for the former way: if you pull, then you edit, then I edit, then you pull again, there will likely be a conflict if we both changed the same files. I recommend to put your edited copies of the repository contents in a separate folder, so to keep your edits (ideally, you could do versioning on a repository of your own!).
- Install conda using the Anaconda distribution, remember to pick Python 3.7 and the OS you need. Get the graphical installer.
- After installation, you will have an app called Anaconda Navigator installed. You can create and manage enviromnents and use jupyter notebooks from it, without using the terminal, mostly.
- If you use the terminal, remember to relunch all your terminal windows after the installation of conda. Then refer to this guide. The msot basic commands are:
conda create -n myenv python=3.7 anaconda
which will create an environment namedmyenv
and install the libraries in the anaconda distribution into it (handy to have most of the popular stuff at the ready).conda activate myenv
.conda deactivate
.conda remove --name myenv --all
to remove an environment and all its packages.
This should be straightforward if you have the Anaconda Navigator or have an environment created as detailed above. More info here.