Readings
A good reference book for Python is the Fluent Python book by Luciano Ramalho. The book is indeed a reference book, but contains invaluable information on the core of the Python language. It provides several examples of well-built code, and is a must read to master the language.
The book Python Tricks by Dan Bader discusses some of the more advanced, but key features of the Python language: like context managers, dunders, string formatting, decorators, argument unpacking, decorators for objects, iterators and generators. We will cover some of these topics during class, but the book serves as a good reference for when you need to quickly remember these topics.
Python Cookbook by Beazley and Jones provides several snippets of codes for the most varied range of advanced topics in Python. The book is a good offline reference for some interesting questions, like:
- How to have more than one constructor in a class?
- How to reload a module?
- How to write functions that only take keyword arguments?
Going through the book's Table of Contents is a good idea, since it might contain the answer to problems you might be having.
Although we will not discuss Machine Learning during this course, it is a topic that is growing in importance in the Economics field. Python became the mother language for Machine Learning ever since the introduction of the packages TensorFlow (created and used by Google), Keras and Scikit-Learn. A good way to learn Machine Learning is by learning the algorithms and using them hands-on. The book Hands-On Machine Learning with Scikit-Learn and TensorFlow by Geron provides a very practical introduction to the topic, and serves as a cookbook for several algorithms in Machine Learning.
Documentation to Read
Online Lectures to Watch
Extra Materials
- Modern Python LiveLessons by Raymond Hettinger
- Animations in Matplotlib
- Integrating Python with Other Programming Languages
- Type Hints in Python
- Statsmodels Linear Regression Standard Error Estimates
- Jupyter Notebook with Large Displays
- Difference Between
venv
,pyenv
,virtualenv
and others - Fluid Dynamics with Python
- Using
pip
to create a list of packages to install - QuantEcon