Example: marketing

Introduction to Python for Econometrics, Statistics and ...

Introduction to Python forEconometrics, Statistics and Data Analysis3rd Edition, 1st RevisionKevin SheppardUniversity of OxfordMonday 9thSeptember, 20192- 2019 Kevin SheppardChanges since the Third Edition Verified that all code and examples work correctly against 2019 versions of modules. The notablepackages and their versions are: Python (Preferred version) NumPy: SciPy: pandas: matplotlib: Python support has been officially dropped, although most examples continue to work with not Python 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.

Introduction 1.1 Background These notes are designed for someone new to statistical computing wishing to develop a set of skills nec-essary to perform original research using Python. They should also be useful for students, researchers or practitioners who require a versatile platform for econometrics, statistics or general numerical analysis

Tags:

  Research, Introduction, Python

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Introduction to Python for Econometrics, Statistics and ...

1 Introduction to Python forEconometrics, Statistics and Data Analysis3rd Edition, 1st RevisionKevin SheppardUniversity of OxfordMonday 9thSeptember, 20192- 2019 Kevin SheppardChanges since the Third Edition Verified that all code and examples work correctly against 2019 versions of modules. The notablepackages and their versions are: Python (Preferred version) NumPy: SciPy: pandas: matplotlib: Python support has been officially dropped, although most examples continue to work with not Python 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.

2 Updated to changes in line profiler (see ) Updated deprecations in pandas. Removedholdfrom plotting chapter since this is no longer required. Thanks for Gen Li for multiple typo reports. Tested all code on Pyton Code has been tested against the current set of modules installed byconda as of February 2018. The notable packages and their versions are: NumPy: Pandas: to the 3rdEditionThis edition includes the following changes from the second edition (August 2014): Rewritten installation section focused exclusively on using Continuum s Anaconda. Python is the default version of Python instead of Python (or newer) is well supported bythe Python packages required to analyze data and perform statistical analysis, and bring some newuseful features, such as a new operator for matrix multiplication Removed distinction between integers and longs in built-in data types chapter.

3 This distinction isonly relevant for Python dothas 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 pandas Updated syntax of pandas functions such asresample. Added pandasCategorical. Expanded coverage of pandasgroupby. Expanded coverage of date and time data types and functions. New chapter introducing statsmodels, a package that facilitates statistical analysis of data. statsmod-els includes regression analysis, Generalized Linear Models (GLM) and time-series analysis usingARIMA since the Second Edition Fixed typos reported by a reader thanks to Ilya Sorvachev Code verified against Anaconda Added diagnostic tools and a simple method to use external code in the Cython section.

4 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 graphicschapter. Based on experience teaching Python to economics students, the recommended installation hasbeen simplified by removing the suggestion to use virtual environment. The discussion of virtualenvironments 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 additionalpackages.

5 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 to the 2ndEditionThis edition includes the following changes from the first edition (March 2012): The preferred installation method is now Continuum Analytics Anaconda. Anaconda is a completescientific stack and is available for all major platforms. New chapter on pandas. pandas provides a simple but powerful tool to manage data and performpreliminary analysis. It also greatly simplifies importing and exporting data. New chapter on advanced selection of elements from an array. Numba provides just-in-time compilation for numeric Python code which often produces large per-formance gains when pure NumPy solutions are not available ( looping code).

6 Dictionary, set and tuple comprehensions Numerous typos All code has been verified working against Anaconda Background.. Conventions.. Important Components of the Python Scientific Stack.. Setup.. Using Python .. Exercises.. Additional Installation Issues..132 Python vs. 3 (and the rest) Python vs.. Intel Math Kernel Library and AMD s GPUOpen Libraries.. Other Variants.. Relevant Differences between Python and 3..203 Built-in Data Variable Names.. Core Native Data Types.. Additional Container Data Types in the Standard Library.. Python and Memory Management.. Exercises..374 Arrays and Array.. Matrix.. 1-dimensional Arrays.

7 2-dimensional Arrays.. Multidimensional Arrays.. Concatenation.. Accessing Elements of an Array.. Slicing and Memory Management.. Modules.. Calling Functions.. Exercises..545 Basic Operators.. Broadcasting.. Addition (+) and Subtraction (-).. Multiplication (*).. Matrix Multiplication .. Array and Matrix Division (/).. Exponentiation (**).. Parentheses.. Transpose.. Operator Precedence.. Exercises..626 Basic Functions and Numerical Generating Arrays and Matrices.. Rounding.. Mathematics.. Complex Values.. Set Functions.. Sorting and Extreme Values.. Nan Functions.. Functions and Methods/Properties.. Exercises.

8 747 Special Exercises..788 Array and Matrix Views.. Shape Information and Transformation.. Linear Algebra Functions.. Exercises..909 Importing and Exporting Importing Data using pandas.. Importing Data without pandas.. Saving or Exporting Data using pandas.. Saving or Exporting Data without pandas.. Exercises..101 CONTENTSxi10 Inf,NaNand Numeric .. Floating point precision.. Exercises..10411 Logical Operators and >,>=,<,<=,==,!=.. and, or, not and xor.. Multiple tests.. *.. Exercises..11112 Advanced Selection and Numerical Indexing.. Logical Indexing.. Performance Considerations and Memory Management.. Assignment with Broadcasting.. Exercises.

9 12413 Flow Control, Loops and Exception Whitespace and Flow Control..elif..else..except.. List Comprehensions.. Tuple, Dictionary and Set Comprehensions.. Exercises..13514 Dates and Creating Dates and Times.. Dates Mathematics.. Numpy..13815 seaborn.. 2D Plotting.. Advanced 2D Plotting.. 3D Plotting.. General Plotting Functions.. Exporting Plots.. Exercises..160xiiCONTENTS16 Data Structures.. Statistical Functions.. Time-series Data.. Importing and Exporting Data.. Graphics.. Examples..19717 Structured Mixed Arrays with Column Names.. Record Arrays..20618 Custom Function and Functions.. Variable Scope.. Example: Least Squares with Newey-West Covariance.

10 Anonymous Functions.. Modules.. Packages.. PYTHONPATH.. Python Coding Conventions.. Exercises.. Listing of ..22019 Probability and Statistics Simulating Random Variables.. Simulation and Random Number Generation.. Statistics Functions.. Continuous Random Variables.. Select Statistics Functions.. Select Statistical Tests.. Exercises..24120 Statistical Analysis Regression..24321 Non-linear Function Unconstrained Optimization.. Derivative-free Optimization.. Constrained Optimization.. Scalar Function Minimization.. Nonlinear Least Squares.. Exercises..25822 String String Building.. String Functions.. Formatting Numbers.. Regular Expressions.. Safe Conversion of Strings.


Related search queries