This is intended to be the first module in the bootcamp. It assumes students come with minimal-to-no knowledge of Python.
Learning objective
Students will learn what Python is, and why it is important in data science and machine learning. This includes details about the vast open source libraries that exist in Python, how to install them using Pip, general module imports, and the bare-bones basics of Python in an interactive environment (Google Colab notebook): variables, declarations, functions, etc.
Content to cover
Overview
Very brief history/overview of the language compared to others (i.e. why use Python?). Good to mention the rich open source community here. Also good to mention that Python is the language of ML in 99% of use cases.
Using Jupyter notebooks. Brief note on IDEs (though we will not cover IDEs in this particular bootcamp).
Basic syntax and data types
Numerical variables: deefining your first variable (x=2); variables and data types (e.g. difference between a float and int).
Non-numerical variables: strings and booleans.
Basic arithmetic, logical and comparison operations.
Basic Python data structures
Lists (how to create, index and slice).
Tuples (how are tuples different than lists?). Why do we use tuples at all?
Dictionaries (key-value pairs, methods on dictionaries).
Sets (creating and manipulating them; why do we use sets?).
Note the practical computational complexity on these objects.
Control flow
Contitionals (if, else if, else).
Loops (for and while; continue, break and pass statements).
Functions
Why do we want to use functions at all?
Defining functions with def.
Function arguments (note keyword arguments and defaults).
Function documentation!
Modules and packages
So far, everything above can be done without any imports, even from the standard library. This is a good moment to tell students about the standard library.
How to import modules (for example, starting with datetime or math, show some examples).
Note that the user can create their own modules, though we won't do that here.
Filesystems
Opening, closing, reading to and writing from basic text files.
User input using input. Note we should go over when this would be used (especially in the context of the capstone below).
Exception handling
What is an exception?
Try/except blocks.
finally and else statements in context.
Classes
The class is the basic object in Python. Even if you didn't know it, you've been using them this entire time.
Class __init__, attributes, methods, etc.
Non-goal: inheritance. We'll go over more of this later.
Capstone
Students should be challenged to create their own "game" using Python. The game can be about anything, but it should utilize a minimum of two of the concepts outlined here. For example, the student's game might include many if/else if/else statements, and also write a log of the "character's" actions to disk in a log.txt file or something along those lines.
Introduction to Python
This is intended to be the first module in the bootcamp. It assumes students come with minimal-to-no knowledge of Python.
Learning objective
Students will learn what Python is, and why it is important in data science and machine learning. This includes details about the vast open source libraries that exist in Python, how to install them using Pip, general module imports, and the bare-bones basics of Python in an interactive environment (Google Colab notebook): variables, declarations, functions, etc.
Content to cover
Overview
Basic syntax and data types
x=2
); variables and data types (e.g. difference between a float and int).Basic Python data structures
Control flow
if
,else if
,else
).Functions
def
.Modules and packages
datetime
ormath
, show some examples).Filesystems
input
. Note we should go over when this would be used (especially in the context of the capstone below).Exception handling
finally
andelse
statements in context.Classes
__init__
, attributes, methods, etc.Capstone
Students should be challenged to create their own "game" using Python. The game can be about anything, but it should utilize a minimum of two of the concepts outlined here. For example, the student's game might include many
if
/else if
/else
statements, and also write a log of the "character's" actions to disk in alog.txt
file or something along those lines.