Basics of Python


Tuesday, May 24  &  Thursday, May 26
9:30am–12:30pm Pacific Time

This course will start at 9:30am Pacific Time and will run until 12:30pm Pacific Time.

  • Commands typed in the text editor on Day 1

This introductory course will walk you through the basics of programming in Python. We will cover the main language features – variables and data types, conditionals, lists, for/while loops, list comprehensions, dictionaries, writing functions – as well as working with external libraries such as numpy (mathematical arrays), pandas (data frames), and matplotlib (basic plotting).

Instructor: Alex Razoumov (SFU)

Prerequisites: none.

Software: We will be using Python on our training cluster, so no need to install it on your computer. However, in the long run you would probably benefit from Python on your computer, so you might want to look into this. During the workshop you will likely need a remote secure shell (SSH) client installed on your computer in order to participate in the course exercises. On Windows we recommend the free Home Edition of MobaXterm. On Mac and Linux computers SSH is usually pre-installed (try typing ssh in a terminal to make sure it is there).


Zoom   Day 1 - 9:30am-12:30pm Pacific
Setup and various ways to run Python
Variables and data types
Built-in functions and help
Conditionals
Lists
Loops
Dictionaries
Writing functions
Variable scope and floating precision


Zoom   Day 2 - 9:30am-12:30pm Pacific
Libraries, virtual environments and packaging
Numpy
Plotting with matplotlib
Pandas dataframes
Multidimensional labeled arrays and datasets with xarray
Running Python scripts from the command line (additional material)
Basics of object-oriented programming in Python (additional material)