This is a repository for Stanford Economics students who want to use Python during the first year PhD sequence.
- Popular: python is one of the most used programming langugages in the world!
- Community: the python community provides lots resources to make python better: open source packages; and forums with plenty of questions and answers; and videos and tutorials to use packages.
- Free and open source: You can always look under the hood to see what packages doing. Anyone can run your code without paying for software like Matlab or Stata, and Jupyter notebooks make it easy to share your code and results together.
- General purpose: Modern economic research involves lots of tasks, many of which can be done in python: computing and estimating models (numpy, scipy, numba), data analysis (pandas), doing algebra (sympy), mapping (geopandas), machine learning (keras, tensorflow, pytorch), webscraping (beautiful soup), text analysis (nlkt), digitizing records (layout-parser), creating websites (Jupyter plus GitHubPages), parallel programming on the GPU (cupy, numba).
In this repo we provide resources to learn python and get ready for the first year sequence. This includes:
- Getting set up with Python [link]
- Starting to program with Python [Notebook]
- Precamp problem set a (fibonacci) [Notebook] [Data] [With solutions]
- Precamp problem set b (data) [Notebook] [With solutions]
- Precamp problem set c (pareto) [Notebook] [With solutions]
You can also find all the material from progrmaming camp, which includes introductions to Matlab and Stata [in the repo.]
Here are some resources we found useful
- Stanford crowdsourced programming resources
- QuantEcon. A website with many examples of models solved with Python (and Julia too!).
- Cheetsheet by Quantecon for Python; Python vs Matlab vs Julia; Stats: Python pandas vs Stata vs R.
- Introduction to Scientific Computing with Python (CME 193). A one-unit course at Stanford -- worth taking at some point to see the full capacity of Python.
- Toward Data Science. Short articles on all things Python. Want to know how to use some of the packages listed above? There is bound to be an intro here.
- Stata to Python Cheatsheet
- Intro to Github