Introductory Python Programming
This is an introductory course designed to teach practical skills in the Python programming language for both current and aspiring actuaries. The course duration is eight weeks and covers a topics designed to give students a fundamental understanding of scripting and tooling in Python.
Instructor: Joshua Pam

I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Objectives
By taking this course you will learn the following skills:
- Fundamentals of Python syntax and basics of object-oriented programming
- How to load, manipulate, query, and prepare complex data sets for analysis
- Techniques in web scraping for collecting data online
- Preparing a dashboard to present a final deliverable to relevant stakeholders

Course Schedule
Week 1: Python Syntax
Content:
- Installing Anacondas and Jupyter Notebooks
- Executing code in the Python 3 console
- Data types
- Loops
- List comprehension
- Condition statements
- Creating functions
- Python API
- Introduction to arrays in NumPy
Application:
- Performing complex calculations using multi-dimensional arrays
- Creating functions which handle multiple inputs and constraints
- Importing useful tools and libraries in Python as needed
Week 2: Introduction to Object-Oriented Programming
Content:
- Classes and objects
- Methods and attributes
- Four pillars of OOP:
- Encapsulation
- Inheritance
- Polymorphism
- Abstraction
- Best practices
- Static and class-based methods
- Advanced OOP features
Application:
- Automating tasks
- Creating class-based models
- Writing reusable and modular code
- Scripting and tooling
Week 3: Data in Python
Content:
- Introduction to Pandas
- Indexing and primary keys
- Data attributes
- Data quality/documentation
- Imputation and removal
- Handling erroneous data (preprocessing):
- missing
- duplicated
- irrelevant
- inconsistent
Application:
- Cleaning, preparing, and organizing otherwise messy data
- Reducing the number of features in a dataset to simplify the analysis
- Fixing erroneous records
- Debugging
Week 4: Data Manipulation
Content:
- Merging and joining dataframes
- Reshaping datasets
- Time-based attributes
- Encoding categorical data
- Scaling numeric data
Application:
- Preparing data for statistical modeling and machine learning
- Combining related datasets
- Applying functions and transformations
Week 5: Exploratory Analysis
Content:
- Graphing in Matplotlib/Seaborn
- Retrieving summary statistics
- Hypothesis testing using SciPy
- Modeling in Statsmodels API
- Detecting outliers
Application:
- Understanding claim distributions
- Describing policyholder characteristics
- Identifying impact of new policies
- Model assumption validation
- Anomaly/novelty detection
Week 6: Data Collection
Content:
- Data storage and retrieval
- Fetching web-page data using web-scraping w/ BeautifulSoup
- Handling pagination and dynamic content
- Handling errors and exceptions
- Storing raw data into a readable file
Application:
- Gathering and formatting data from online sources into a usable file in Python
- Performing a meta-analysis using multiple sources of data
Week 7: Automation
Content:
- Manual vs. automated workflows
- Report generation
- Scheduling tasks
Application:
- Automating the preparation of policyholder reports
- Updating data
- Cleaning and preprocessing claims data
- Generating projections or charts for presentations
Week 8: Advanced Visualization
Content:
- Introduction to Plotly
- User interfaces (UI)
- Basics of dashboards:
- Graphs and charts
- Filter
- Dropdown menus
Application:
- Creating interactive charts and graphs
- Organizing a deliverable result to a relevant stakeholder
- Combining multiple graphs and content into a cohesive layout
Final Project
At the conclusion of the course there will be an assigned project using the 2024 U.S. Life Tables from the CDC where students will perform a mortality analysis in Python.
Prerequisites:
Students should have at least a basic understanding of the following topics and exams.
- Probability and statistics
- Financial mathematics
- Linear algebra
- Microsoft Excel
Required Software:
- GitHub
- Anaconda Navigator:
- Jupyter Notebooks
- Spyder