This repository contains exercises for students joining NIU in the summer. The exercises are designed to be completed in Python, and are intended to be completed in the order they are presented.
The exercises would not give you a comprehensive understanding of Python, but they should give a good starting point. The completion of these exercises is required to be able to work on the project as they cover a lot of the basics.
Comprehensive intro to computer science: CS50x or CS50 course dedicated to Python.
You can go through the material before starting the exercises or do them in parallel.
Links to further resources useful to dive into topics we are going to chat about are going to be added here.
- Introduction to Python: print statements, loops, functions
- Introduction to NumPy: arrays, indexing, slicing, broadcasting
- From arrays to images: using NumPy to manipulate images and matplotlib to display them
- More on images: writing functions to for thresholding, exploring scikit-image
You can find the exercises in the folder nuffield_students_exercises
and they contain a series of instructions
and questions that you need to answer.
In order to complete these exercises, you will need to have Python installed on your computer. We recommend using miniconda, which is a lightweight version of the Anaconda distribution. You can download miniconda from here.
Note
For Windows users.
Download and run the installer from the link above. Make sure to select the option to add miniconda to your PATH. This will allow you to run conda commands from your terminal.
If you do not select this option, you will need to add conda to your path. In the start menu, search for "Edit the system environment variables" and click on the button that says "Environment Variables". In the "System variables" section, find the "Path" variable and click on "Edit". Click on "New" and add the path to the miniconda installation directory. This is usually C:\Users\<your-username>\miniconda3\Scripts
and C:\Users\<your-username>\miniconda3\Library\bin
.
You will need to restart your terminal for the changes to take effect.
See also this tutorial.
Once you have installed miniconda, you can create a new conda environment by running the following command in your terminal:
conda create --name learn-python python=3.12
This will create a new conda environment called learn-python
with Python 3.12 installed.
You can activate the conda environment by running the following command in your terminal:
conda activate learn-python
You can clone the repository by running the following command in your terminal:
git clone https://github.com/neuroinformatics-unit/students-exercises.git
You will need to install the required packages to complete the exercises. You can do this by running the following command in your terminal:
pip install -r requirements.txt
You can run the exercises by running the following command in your terminal:
python -m nuffield_students_exercises/1_intro_to_python.py