Welcome all! This is the first part of the MRC Cognition and Brain Sciences Unit's PyBrain workshop, and will provide an introduction to Python. No prior experience is required or expected: we'll start from the very start, and work our way up from there.
A workshop organised by Dr Johan Carlin at the MRC Cognition and Brain Sciences Unit (University of Cambridge). The workshop is a virtual event comprising Zoom sessions and interactive worksheets. If you signed up for the event, you'll have access to both. The workshop comprises several sessions on Python and neuroimaging in Python. See the full programme here: pybrain-workshop.github.io/
Sure, go for it! The worksheets should be pretty self-explanatory, so you're very welcome to go through them independently.
- 9:30 - 10:30 Jupyter, variables, and functions
- 10:30 - 11:00 Independent work and break
- 11:00 - 12:00 Writing functions and classes
- 12:00 - 13:00 Lunch
- 13:00 - 14:00 NumPy and reading data
- 14:00 - 14:30 Independent work and break
- 14:30 - 15:30 Data handling and visualisation
- 9:30 - 10:30 Implementing statistical tests
- 10:30 - 11:00 Independent work and break
- 11:00 - 12:00 Model fitting through minimisation
- 12:00 - 13:00 Lunch
- 13:00 - 14:00 Programming experiments
- 14:00 - 14:30 Independent work and break
- 14:30 - 15:30 Using Python at home and in the lab
The worksheets for this workshop are Jupyter Notebooks. They can be rendered right here, on GitHub, but they won't be interactive in that way. However, you can also open them in MyBinder or Google Colab. These services will render notebooks from GitHub in an interactive environment, allowing you to run Python right in your browser!
Binder is a great open-source website created by some amazing science folks. It's important to realise that mybinder.org is supported by grants and donations. For that reason, it's good practice to not overload them.
As an aside, please avoid using Binder for any for-profit purposes. Financially benefiting from other people's unpaid labour is not cool. What are you, Elsevier?
Google is getting in on the "running Python online" action, and has put their servers at the public's disposal (with some caveats to prevent naughty usage and/or excess traffic).
- Jupyter, variables, and functions
- Writing functions and classes
- NumPy and reading data
- Data handling and visualisation
- Implementing statistical tests
- Model fitting through minimisation
Follow these steps to use the Jupyter Notebooks:
- Log into your Google account.
- Open a notebook.
- There will come a time during which you will need to read files. Google Colab is a bit weird about that. The Notebooks will tell you how to deal with it, and you can pro-actively follow the rest of these steps.
- Open Google Drive.
- Create a folder
PyBrainon yourMy Drivespace. - Download a handy zipped archive with all files required for the notebooks.
- Unzip the files to your local computer.
- Upload these files to the
PyBrainfolder on Google Drive. - Done! You'll be informed about how to use these files in the relevant Notebooks.