DSCI011ProgramminginPythonforDataScience

Module 5: Making Choices and Repeating Iterations

In this module, you will learn how to write conditionals and learn the fundamentals of how to create code that efficiently repeats the same operations following the DRY principle.

0Module Learning Outcomes

1Making Choices with Conditional Statements

2Quick Questions with Conditionals

3Will it Run with Conditionals

4Creating Conditional Statements

5Creating an Inline if/else Statement

6Repeated Iterations (Loops)

7Repeated Iterations Questions

8Practice Iterating Over a Collection

9Range and Comprehensions

10 Range Questions

11Practice Iterating using Range

12Applying Range with Dataframes

13Nested Loops

14Nested Loop Questions

15Making a Nested Loop

16Repeated Iterations with Conditions

17Conditional Loop Questions

18Practice Iterating Over a Collection

19Functions

20Function Questions

21Making a Function from Existing Code

22Making a Function

23What Did We Just Learn?

About this course

Basic programming in Python. Overview of iteration and flow control and data types relevant to data exploration and analysis. When and how to exploit pre-existing libraries. Numerical data types with Numpy and tabular data with Pandas.

About the program

The University of British Columbia (UBC) is a comprehensive research-intensive university, consistently ranked among the 40 best universities in the world. The MDS Mid Career Learners program was launched in September 2020 and is offered by the MDS program who are a collaboration between the UBC Department of Computer Science and Department of Statistics.