/practical_python

Learn just enough Python to start analyzing and visualizing data.

Primary LanguageJupyter Notebook

Practical Python

Python for busy Neuroscientists. From "Hello World" to Deep Lab Cut.

Our mascot, Hazel the Green Tree Python.

Introduction

This is a Python crash course for complete beginners. In the first two weeks we will learn the fundamentals of Python using the freely available book Automate the Boring Stuff with Python) (ATBS). The third week we will cover the basics of the data science stack that you can use for analysis and visualization of data. The final week will be a deep dive into a practical project using Deep Lab Cut, a library for tracking animal behavior that uses deep learning and convolutional neural networks.

This will be a "flipped" class, where you learn a lot outside of the class each week. Each week you will spend a lot of time learning about Python and practicing coding before each class. Then in class, we will go over any questions you had about the material, reinforcing any key points, and going over code with your instructor.

Outline

Week 0: Setting up Jupyter and Python

This week you will set up your programming environment. We will be using Jupyter notebooks, which have become the tool of choice among scientists for sharing code. For this week, just go to getting_started.md and follow the instructions there. If you already have Jupyter/Conda sete up, you can skip to Step 3 of that page (cloning this repo and running the notebook for the week).

Week 1: Python basics and flow control

Now that you can use Python and run Jupyter notebooks, you are ready to start doing Python. We will cover the basics of Python, and the important topic of flow control (e.g., for loops). This material corresponds to Chapters One and Two of Automate the Boring stuff and is covered in the Jupyter notebook week1.ipynb.

Week 2: Functions and data structures

We will finish out our overview of the fundamentals of Python by looking at functions in Python, and the main types of data structures (lists, tuples, dictionaries, and strings). These topics correspond to Chapters 3-6 of Automate the Boring Stuff and can be found in the Jupyter notebook week2.ipynb.

Week 3: Files, virtual environments, and the data science stack

Files, virtual environments, and an introduction to the data science stack (with a focus on numpy, pandas, and matplotlib). We will do some number crunching and data visualization this week.

Week 4: Deep lab cut

Using Python IRL. This week you will do a deep dive into a project that approaches the messiness of real life. It will be a lot of work, and your computer will work pretty hard too (many hours to train the model). You will see deep learning in action, and get hands-on skills with an extremely useful package.

To do

  • for week1 class fix it to use two cameras: one for zoom, one to extract and do facial recog.
  • Add open ended section at end of each class for students to write questions (do for class 1 will serve as template students can email me those)
  • Add "notes" section at end of each class for students to write notes for in-class section (do for class 1)
  • getting_started needs quite a bit of work.
  • Also need instructions on how to change default browswer in my windows fresh install it defaulted to freaking MS Edge :(
  • do this readme pretty much last just make the classes.

Acknowledgments

  • Developed with the support from NIH Bioinformatics and the Neurobehavioral Core at NIEHS.
  • Green Tree Python image is from Wikimedia.