Introduction to Python for Econometrics, Statistics and ...

[Pages:427]Introduction to Python for Econometrics, Statistics and Data Analysis

3rd Edition, 1st Revision

Kevin Sheppard University of Oxford Monday 9th September, 2019

2

-

?2019 Kevin Sheppard

Changes since the Third Edition

? Verified that all code and examples work correctly against 2019 versions of modules. The notable packages and their versions are: ? Python 3.7 (Preferred version) ? NumPy: 1.16 ? SciPy: 1.3 ? pandas: 0.25 ? matplotlib: 3.1

? Python 2.7 support has been officially dropped, although most examples continue to work with 2.7. Do not Python 2.7 in 2019 for numerical code.

? Small typo fixes, thanks to Marton Huebler. ? Fixed direct download of FRED data due to API changes, thanks to Jesper Termansen. ? Thanks for Bill Tubbs for a detailed read and multiple typo reports. ? Updated to changes in line profiler (see Ch. 24) ? Updated deprecations in pandas. ? Removed hold from plotting chapter since this is no longer required. ? Thanks for Gen Li for multiple typo reports. ? Tested all code on Pyton 3.6. Code has been tested against the current set of modules installed by

conda as of February 2018. The notable packages and their versions are: ? NumPy: 1.13 ? Pandas: 0.22

ii

Notes to the 3rd Edition

This edition includes the following changes from the second edition (August 2014): ? Rewritten installation section focused exclusively on using Continuum's Anaconda. ? Python 3.5 is the default version of Python instead of 2.7. Python 3.5 (or newer) is well supported by the Python packages required to analyze data and perform statistical analysis, and bring some new useful features, such as a new operator for matrix multiplication (@). ? Removed distinction between integers and longs in built-in data types chapter. This distinction is only relevant for Python 2.7. ? dot has been removed from most examples and replaced with @ to produce more readable code. ? Split Cython and Numba into separate chapters to highlight the improved capabilities of Numba. ? Verified all code working on current versions of core libraries using Python 3.5. ? pandas ? Updated syntax of pandas functions such as resample. ? Added pandas Categorical. ? Expanded coverage of pandas groupby. ? Expanded coverage of date and time data types and functions. ? New chapter introducing statsmodels, a package that facilitates statistical analysis of data. statsmodels includes regression analysis, Generalized Linear Models (GLM) and time-series analysis using ARIMA models.

iv

Changes since the Second Edition

? Fixed typos reported by a reader ? thanks to Ilya Sorvachev ? Code verified against Anaconda 2.0.1. ? Added diagnostic tools and a simple method to use external code in the Cython section. ? Updated the Numba section to reflect recent changes. ? Fixed some typos in the chapter on Performance and Optimization. ? Added examples of joblib and IPython's cluster to the chapter on running code in parallel. ? New chapter introducing object-oriented programming as a method to provide structure and orga-

nization to related code. ? Added seaborn to the recommended package list, and have included it be default in the graphics

chapter. ? Based on experience teaching Python to economics students, the recommended installation has

been simplified by removing the suggestion to use virtual environment. The discussion of virtual environments as been moved to the appendix. ? Rewrote parts of the pandas chapter. ? Changed the Anaconda install to use both create and install, which shows how to install additional packages. ? Fixed some missing packages in the direct install. ? Changed the configuration of IPython to reflect best practices. ? Added subsection covering IPython profiles. ? Small section about Spyder as a good starting IDE.

vi

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download