Program design and data manipulation with Python. Overview of data structures, iteration, flow control, program design, and using libraries for data exploration and analysis.
Copyright © 2022 Arman Seyed-Ahmadi, Tomas Beuzen, Mike Gelbart, and Patrick Walls
Software licensed under the MIT License, non-software content licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License. See the license file for more information.
Find Panopto lecture recordings here.
Lecture | Topic | Optional pre-readings |
---|---|---|
1 | Basics | WTP: Section 3 - Section 7 |
2 | Loops & Functions | WTP: Section 8 - Section 13 PEP 257: Docstrings NumPy docstring examples |
3 | Unit Tests & Classes | Python documentation: 9. Classes Think Python: "Classes and objects", "Classes and functions", "Classes and methods" |
4 | Style Guides, Scripts, Imports | PEP 257: Style Guide Getting Started with Python in VS Code up to "Run Hello World" Python documentation: 5. The import system |
5 | Introduction to NumPy | PDSH: Introduction to Numpy Numpy documentation: Quickstart tutorial |
6 | Introduction to Pandas | PDSH: Data Manipulation with Pandas up to "Operating on Data in Pandas" Pandas documentation: 10 minutes to pandas, up to "Selection" |
7 | Basic Data Wrangling with Pandas | PDSH: Data Manipulation with Pandas Pandas documentation: 10 minutes to pandas |
8 | Advanced Data Wrangling with Pandas | PDSH: Data Manipulation with Pandas Pandas documentation: 10 minutes to pandas |
There will be one lab assignment per week. We will follow the standard MDS lab deadlines.
Quizzes will be open book, meaning you may consult course materials, online sources, etc. However, communication with other people during the quiz is strictly forbidden. For more information, see the MDS quiz instructions.
- Translate fundamental programming concepts such as loops, conditionals, etc into Python code.
- Understand the key data structures in Python.
- Understand how to write functions in Python and assess if they are correct via unit testing.
- Know when and how to abstract code (e.g., into functions, or classes) to make it more modular and robust.
- Produce human-readable code that incorporates best practices of programming, documentation, and coding style.
- Use NumPy perform common data wrangling and computational tasks in Python.
- Use Pandas to create and manipulate data structures like Series and DataFrames.
- Wrangle different types of data in Pandas including numeric data, strings, and datetimes.
- Official Python tutorial
- Think Python: How to Think Like a Computer Scientist
- A Whirlwind Tour of Python (WTP), Jake VanderPlas (O’Reilly). Copyright 2016 O’Reilly Media, Inc., 978-1-491-96465-1.
- Python Data Science Handbook (PDSH), Jake VanderPlas (O’Reilly). Copyright 2016 O’Reilly Media, Inc., 978-1-491-91205-8.
- Python for Data Analysis, Wes McKinney (O'Reilly). Copyright 2013 O’Reilly Media, Inc, you can download chapters from the book for free from the UBC library.
- Kaggle Learn Python Tutorials