Course repository for the Fall 2024 edition of Introduction to Python for Neuroscientists, run by the Columbia Neurobiology and Behavior PhD program.
Course description: This class will give students a general and applied introduction to Python within the context of neuroscience. Topics covered will include setting up python, using git to track and publicize work, programming basics, data manipulation and visualization, machine learning, and navigating existing codebases. The course will culminate in a project where students will analyze data of their choice in Python (options will be provided for students who don’t have their own datasets). Students will then work to understand each other’s projects to get experience reading and understanding each others’ code, and to incentivize good documentation. Students will present their work to the class.
Course Structure: Classes will consist of live programming and instruction, alongside optional out-of-class homework (see important dates below for details). Pair and group-programming will be used in addition to individual programming. Please bring your laptop – if you do not have one / that will be an issue, please contact us.
Prerequisites: No background in programming or math is required. All we ask is that you come with a desire to learn :)
Grades will be based on participation and the final project.
Email: [email protected]
Important dates:
- By 9/3: Watch pre-videos, setup computer, and make a github account following these instructions.
- Weeks 6-7: set up a time if you want to discuss your project with us
- By 11/05: Submit 1-page project proposal
- Week 9: Meet with us to discuss project proposal if necessary.
- By 12/03: Submit project.
- 12/10: Presentations
Schedule (subject to change):
Week | Topic | Lecturer | Homework Due |
---|---|---|---|
Week 1 (9/3) | Python Workflow: - Use python locally in VSCode in file form and as Jupyter Notebooks (hello world) - Set up conda environment - Git Basics – create a repo and commit to it |
Abhi | HW0 (Submit on courseworks) |
Week 2 (9/10) | Python Basics: - Why use python? - Data Types & Variables (float, int, str, list, dict, tuple) - Booleans & If/Else |
Sam | |
Week 3 (9/17) | Python Basics: - Lists - Dictionaries- Tuples - For Loops - List Comprehension - Enumerate |
Sharon | |
Week 4 (9/24) | Python Basics: - While Loops - Functions - return - *args and **kwargs - Errors - Try/Except - Typehinting/Docstrings |
Sharon | |
Week 5 (10/1) | Numpy: - Why do we need numpy? - Basic numpy functionalty - How to manipulate and read out arrays - How to solve mathematical problems in Python. |
Sharon | |
Skip for SfN (10/8) | NO CLASS | ||
Week 6 (10/15) | Pandas and Data Visualization: - Why is Pandas useful, and why do we need it for data science in Python? - How do we use Pandas to manipulate data? - How can we load and save data in pandas? - How can we plot basic data in Python? |
Sam | |
Week 7 (10/22) | Data Visualization and Object-oriented programming - How can we make more complicated plots in Python? - How can we use Seaborn to travers and plot large, complex datasets? - How do we use documentation to find solutions to programming questions and problems? - What is the basic structure of OOP in Python? - How do we read others' OOP code? |
Sam | |
Week 8 (10/29) | Navigating an expert codebase: - Given a problem/input and a desired output, how can we use existing resources to implement a solution? - Working through documentation and online resources to learn a package - Adapting prewritten pipelines to custom needs |
Abhi | HW8 (Submit on courseworks) |
Skip for election week (11/5) | NO CLASS | ||
Week 9 (11/12) | Machine learning | Abhi | |
Week 10 (11/19) | Project Day | ||
Week 11 (11/26) | Project Day | ||
Week 12 (12/3) | Understanding Day | ||
Week 13 (12/10) | Presentations |
- Go beyond what we covered in Week 1 with Git, Command Line, Shell, Code Editors and more with The Missing Semester of Your CS Education from MIT
- The Good Research Code Handbook by Patrick Mineault -- good principles for writing research code in a quick and enjoyable read. He also provides information about good tools that are good to explore if you are coding regularly.