Python for Business Research
Rice University
Fall 2023

Instructor

Kerry Back
J. Howard Creekmore Professor of Finance and Professor of Economics
kerryback@gmail.com

Class Meetings

Room 316, 10:15 – 11:45, 8/21/2023 – 10/2/2023

Course Description

This course is intended for PhD students in business and economics. However, it may be appropriate for students in other programs also.

Python is a general purpose programming language that has become especially important for machine learning and for data analysis more generally. It can be used as a substitute for MATLAB, Stata, SAS, and R and also for web scraping, natural language processing, and much more. This course provides an introduction to the language and to the libraries that are most useful for business research. The topics to be covered in the course are listed below. This is a hands-on course, and a part of each class session will be allocated to students working individually or in groups to apply and extend the class material.

ChatGPT makes it much easier to use python. Throughout the course, we will generate python code by using ChatGPT-4 either at the OpenAI website (for this, I highly recommend a Plus subscription) or via an extension to VS Code.

It is fine if you have zero experience with python or any other programming language. It is also fine if you are experienced with python and are taking the course only to learn about certain libraries you haven’t used before. In the former case, I will not expect you to become a proficient programmer in six weeks. My goal in that case is to introduce you to the possibilities and show you how to get started. Googling and ChatGPT can take care of the rest.

Grading

There will be weekly assignments. You are allowed to google and/or to use ChatGPT for assistance with the assignments. There will not be an exam.

Course Schedule

This is a tentative schedule. I think it is a feasible schedule even for students with zero prior programming experience. However, it may be modified based on student interests and experience.

  1. Preliminaries: libraries, IDEs, environments, git
  2. Basic python: data types, conditional statements, loops, functions, classes
  3. Vectors and matrices: numpy
  4. Data handling: pandas
  5. More data handling: pandas and SQL
  6. Visualization: matplotlib, seaborn
  7. Scientific programming: scipy, cvxopt
  8. Statistics: statsmodels, linearmodels
  9. Machine learning for classification: scikit-learn, xgboost
  10. Machine learning for regression and data pipelines: scikit-learn, xgboost
  11. Neural networks: pytorch
  12. Web scraping: beautiful soup, selenium