100% found this document useful (4 votes)
13 views

[FREE PDF sample] (Ebook) Introduction to Python for Econometrics, Statistics and Data Analysis. by Kevin Sheppard. ebooks

The document provides information about various eBooks related to Python, statistics, and data analysis available for download at ebooknice.com. It highlights specific titles, authors, and ISBNs, along with links for instant access to the eBooks in multiple formats. Additionally, it includes notes on updates and changes made in different editions of the 'Introduction to Python for Econometrics, Statistics and Data Analysis' by Kevin Sheppard.

Uploaded by

zaborreuleqm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
13 views

[FREE PDF sample] (Ebook) Introduction to Python for Econometrics, Statistics and Data Analysis. by Kevin Sheppard. ebooks

The document provides information about various eBooks related to Python, statistics, and data analysis available for download at ebooknice.com. It highlights specific titles, authors, and ISBNs, along with links for instant access to the eBooks in multiple formats. Additionally, it includes notes on updates and changes made in different editions of the 'Introduction to Python for Econometrics, Statistics and Data Analysis' by Kevin Sheppard.

Uploaded by

zaborreuleqm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Introduction to Python for Econometrics,


Statistics and Data Analysis. by Kevin Sheppard.

https://ebooknice.com/product/introduction-to-python-for-
econometrics-statistics-and-data-analysis-53726340

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Statistics for Data Scientists: An Introduction to


Probability, Statistics, and Data Analysis by Maurits
Kaptein, Edwin van den Heuvel ISBN 9783030105303,
303010530X
https://ebooknice.com/product/statistics-for-data-scientists-an-
introduction-to-probability-statistics-and-data-analysis-38277340

ebooknice.com

(Ebook) A Python Data Analyst’s Toolkit: Learn Python and


Python-based Libraries with Applications in Data Analysis
and Statistics by Gayathri Rajagopalan ISBN 9781484263983,
9781484263990, 1484263987, 1484263995
https://ebooknice.com/product/a-python-data-analysts-toolkit-learn-
python-and-python-based-libraries-with-applications-in-data-analysis-
and-statistics-22156588
ebooknice.com

(Ebook) Introduction to Statistics and Data Analysis by


Roxy Peck, Chris Olsen, Jay Devore ISBN 9780495557838,
0495557838
https://ebooknice.com/product/introduction-to-statistics-and-data-
analysis-48469252

ebooknice.com

(Ebook) Introduction to statistics and data analysis by


Roxy Peck, Chris Olsen, Jay L. Devore ISBN 9780495118732,
0495118737
https://ebooknice.com/product/introduction-to-statistics-and-data-
analysis-2420162

ebooknice.com
(Ebook) Introduction to Statistics and Data Analysis by
Roxy Peck, Chris Olsen, Jay L. Devore ISBN 9781305115347,
1305115341
https://ebooknice.com/product/introduction-to-statistics-and-data-
analysis-5520260

ebooknice.com

(Ebook) Spatial Analysis Using Big Data: Methods and Urban


Applications (Spatial Econometrics and Spatial Statistics)
by Yoshiki Yamagata, Hajime Seya ISBN 9780128131275,
0128131276
https://ebooknice.com/product/spatial-analysis-using-big-data-methods-
and-urban-applications-spatial-econometrics-and-spatial-
statistics-38430000
ebooknice.com

(Ebook) Introduction to Python in Earth Science Data


Analysis by Maurizio Petrelli ISBN 9783030780548,
9783030780555, 3030780546, 3030780554
https://ebooknice.com/product/introduction-to-python-in-earth-science-
data-analysis-34896642

ebooknice.com

(Ebook) An Introduction to Categorical Data Analysis


(Wiley Series in Probability and Statistics) by Alan
Agresti ISBN 9780471226185, 0471226181
https://ebooknice.com/product/an-introduction-to-categorical-data-
analysis-wiley-series-in-probability-and-statistics-1818286

ebooknice.com

(Ebook) Introduction to Statistics and Data Analysis, 6th


Edition by Peck, Roxy, Olsen, Chris, Short, Tom ISBN
9781337793612, 1337793612
https://ebooknice.com/product/introduction-to-statistics-and-data-
analysis-6th-edition-36359614

ebooknice.com
Introduction to Python for
Econometrics, Statistics and Data Analysis
5th Edition

Kevin Sheppard
University of Oxford

Monday 27th September, 2021


2

©2020 Kevin Sheppard


Notes to the 5th Edition

• Python 3.8 or 3.9 are the recommended versions.

• Added a chapter Code Style.

• Expanded coverage of random number generation and added coverage of the preferred method to gener-
ate random variates, numpy.random.Generator in chapter Simulating Random Variables.

• Verified that all code and examples work correctly against 2020 versions of modules. The notable pack-
ages and their versions are:

– Python 3.9 (Preferred version), 3.7 (Minimum version)


– NumPy: 1.20.3
– SciPy: 1.7.1
– pandas: 1.3.2
– matplotlib: 3.4.2
– statsmodels: 0.13.0
ii
Notes to the 4th Edition

• Python 3.8 is the recommended version. The notes require Python 3.6 or later, and all references to
Python 2.7 have been removed.
• Removed references to NumPy’s matrix class and clarified that it should not be used.
• Verified that all code and examples work correctly against 2020 versions of modules. The notable pack-
ages and their versions are:
– Python 3.8 (Preferred version), 3.6 (Minimum version)
– NumPy: 1.19.1
– SciPy: 1.5.2
– pandas: 1.1.1
– matplotlib: 3.3.1
• Introduced f-Strings in Section 23.3.3 as the preferred way to format strings using modern Python. The
notes use f-String where possible instead of format.
• Added coverage of Windowing function – rolling, expanding and ewm – to the pandas chapter.
• Expanded the list of packages of interest to researchers working in statistics, econometrics and machine
learning.
• Expanded description of model classes and statistical tests in statsmodels that are most relevant for econo-
metrics. Added section detailing formula support. This list represents on a small function of the statsmod-
els API.
• Added minimize as the preferred interface for non-linear function optimization in Chapter 22.
• Python 2.7 support has been officially dropped, although most examples continue to work with 2.7. Do
not Python 2.7 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. 25)
• Updated deprecations in pandas.
• Removed hold from plotting chapter since this is no longer required.
• Thanks for Gen Li for multiple typo reports.
iv
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.
vi
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 organization
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 pack-
ages.

• 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.


viii
Notes to the 2nd Edition

This edition includes the following changes from the first edition (March 2012):

• The preferred installation method is now Continuum Analytics’ Anaconda. Anaconda is a complete
scientific stack and is available for all major platforms.

• New chapter on pandas. pandas provides a simple but powerful tool to manage data and perform prelim-
inary 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 perfor-
mance gains when pure NumPy solutions are not available (e.g. looping code).

• Dictionary, set and tuple comprehensions

• Numerous typos

• All code has been verified working against Anaconda 1.7.0.


x
Contents

1 Introduction 1
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Important Components of the Python Scientific Stack . . . . . . . . . . . . . . . . . . . . . 3
1.4 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Using Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.A Additional Installation Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Built-in Data Types 15


2.1 Variable Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Core Native Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Additional Container Data Types in the Standard Library . . . . . . . . . . . . . . . . . . . 24
2.4 Python and Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3 Arrays 29
3.1 Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2 1-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3 2-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4 Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5 Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.6 Accessing Elements of an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.7 Slicing and Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.8 import and Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.9 Calling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.10 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4 Basic Math 43
4.1 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2 Broadcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.3 Addition (+) and Subtraction (-) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.4 Multiplication (⁎) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.5 Matrix Multiplication (@) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.6 Array and Matrix Division (/) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
xii CONTENTS

4.7 Exponentiation (**) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


4.8 Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.9 Transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.10 Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5 Basic Functions and Numerical Indexing 49


5.1 Generating Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2 Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.3 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.4 Complex Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.5 Set Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.6 Sorting and Extreme Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.7 Nan Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.8 Functions and Methods/Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

6 Special Arrays 61
6.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

7 Array Functions 63
7.1 Shape Information and Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.2 Linear Algebra Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.3 Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

8 Importing and Exporting Data 75


8.1 Importing Data using pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.2 Importing Data without pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3 Saving or Exporting Data using pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.4 Saving or Exporting Data without pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

9 Inf, NaN and Numeric Limits 83


9.1 inf and NaN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.2 Floating point precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

10 Logical Operators and Find 85


10.1 >, >=, <, <=, ==, != . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.2 and, or, not and xor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.3 Multiple tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
10.4 is⁎ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
10.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
CONTENTS xiii

11 Advanced Selection and Assignment 91


11.1 Numerical Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
11.2 Logical Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
11.3 Performance Considerations and Memory Management . . . . . . . . . . . . . . . . . . . 99
11.4 Assignment with Broadcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
11.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

12 Flow Control, Loops and Exception Handling 103


12.1 Whitespace and Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
12.2 if . . . elif . . . else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
12.3 for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
12.4 while . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
12.5 try . . . except . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
12.6 List Comprehensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
12.7 Tuple, Dictionary and Set Comprehensions . . . . . . . . . . . . . . . . . . . . . . . . . . 110
12.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

13 Code Style 113


13.1 PEP8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
13.2 black . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
13.3 isort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
13.4 flake8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
13.5 pylint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

14 Dates and Times 119


14.1 Creating Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
14.2 Dates Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
14.3 Output Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
14.4 Numpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
14.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

15 Graphics 125
15.1 seaborn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
15.2 2D Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
15.3 Advanced 2D Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
15.4 3D Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
15.5 General Plotting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
15.6 Exporting Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
15.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

16 pandas 145
16.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
16.2 Statistical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
16.3 Time-series Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
16.4 Importing and Exporting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
xiv CONTENTS

16.5 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177


16.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
16.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

17 Structured Arrays 187


17.1 Mixed Arrays with Column Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
17.2 Record Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

18 Custom Function and Modules 191


18.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
18.2 Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
18.3 Example: Least Squares with Newey-West Covariance . . . . . . . . . . . . . . . . . . . . 198
18.4 Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
18.5 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
18.6 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
18.7 PYTHONPATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
18.8 Python Coding Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
18.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
18.A Listing of econometrics.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

19 Probability and Statistical Functions 207


19.1 Statistics Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
19.2 Continuous Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
19.3 Select Statistics Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
19.4 Select Statistical Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
19.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

20 Simulating Random Variables 217


20.1 Generating Random Variates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
20.2 Legacy Generation using RandomState . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
20.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

21 Statistical Analysis with statsmodels 229


21.1 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
21.2 Generalized Linear Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
21.3 Other Notable Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
21.4 Time-series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

22 Non-linear Function Optimization 237


22.1 Unconstrained Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
22.2 Derivative-free Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
22.3 Constrained Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
22.4 Scalar Function Minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
22.5 minimize: Unified Interface for Function Minimization . . . . . . . . . . . . . . . . . . . 246
22.6 Nonlinear Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
CONTENTS xv

22.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

23 String Manipulation 249


23.1 String Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
23.2 String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
23.3 Formatting Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
23.4 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
23.5 Safe Conversion of Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
23.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

24 File System Operations 261


24.1 Changing the Working Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
24.2 Creating and Deleting Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
24.3 Listing the Contents of a Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
24.4 Copying, Moving and Deleting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
24.5 Executing Other Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
24.6 Creating and Opening Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
24.7 Reading and Writing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
24.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

25 Performance and Code Optimization 267


25.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
25.2 Timing Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
25.3 Vectorize to Avoid Unnecessary Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
25.4 Alter the loop dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
25.5 Utilize Broadcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
25.6 Use In-place Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
25.7 Avoid Allocating Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
25.8 Inline Frequent Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
25.9 Consider Data Locality in Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
25.10Profile Long Running Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

26 Improving Performance using Numba 275


26.1 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
26.2 Supported Python Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
26.3 Supported NumPy Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
26.4 Diagnosing Performance Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
26.5 Replacing Python function with C functions . . . . . . . . . . . . . . . . . . . . . . . . . . 285
26.6 Other Features of Numba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
26.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

27 Improving Performance using Cython 289


27.1 Diagnosing Performance Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
27.2 Interfacing with External Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
27.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
xvi CONTENTS

28 Executing Code in Parallel 303


28.1 map and related functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
28.2 multiprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
28.3 joblib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
28.4 IPython’s Parallel Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
28.5 Converting a Serial Program to Parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
28.6 Other Concerns when executing in Parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

29 Object-Oriented Programming (OOP) 317


29.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
29.2 Class basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
29.3 Building a class for Autoregressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
29.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326

30 Other Interesting Python Packages 327


30.1 Statistics and Statistical Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
30.2 Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
30.3 Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
30.4 Other Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

31 Examples 331
31.1 Estimating the Parameters of a GARCH Model . . . . . . . . . . . . . . . . . . . . . . . . 331
31.2 Estimating the Risk Premia using Fama-MacBeth Regressions . . . . . . . . . . . . . . . . 335
31.3 Estimating the Risk Premia using GMM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
31.4 Outputting LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

32 Quick Reference 345


32.1 Built-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
32.2 NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
32.3 SciPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
32.4 Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
32.5 pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
32.6 IPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Chapter 1

Introduction

1.1 Background
These notes are designed for someone new to statistical computing wishing to develop a set of skills necessary
to perform original research using Python. They should also be useful for students, researchers or practition-
ers who require a versatile platform for econometrics, statistics or general numerical analysis (e.g. numeric
solutions to economic models or model simulation).
Python is a popular general–purpose programming language that is well suited to a wide range of problems.1
Recent developments have extended Python’s range of applicability to econometrics, statistics, and general
numerical analysis. Python – with the right set of add-ons – is comparable to domain-specific languages such
as R, MATLAB or Julia. If you are wondering whether you should bother with Python (or another language),
an incomplete list of considerations includes:
You might want to consider R if:

• You want to apply statistical methods. The statistics library of R is second to none, and R is clearly at the
forefront of new statistical algorithm development – meaning you are most likely to find that new(ish)
procedure in R.

• Performance is of secondary importance.

• Free is important.

You might want to consider MATLAB if:

• Commercial support and a clear channel to report issues is important.

• Documentation and organization of modules are more important than the breadth of algorithms available.

• Performance is an important concern. MATLAB has optimizations, such as Just-in-Time (JIT) compila-
tion of loops, which is not automatically available in most other packages.

You might want to consider Julia if:

• Performance in an interactive based language is your most important concern.

• You don’t mind learning enough Python to interface with Python packages. The Julia ecosystem is less
complete than Python and a bridge to Python is used to provide missing features.
1
According to the ranking on http://www.tiobe.com/tiobe-index/, Python is the 5th most popular language. http:
//langpop.corger.nl/ ranks Python as 4th or 5th .
2 Introduction

• You like to do most things yourself or you are on the bleeding edge and so existing libraries do not exist
with the features you require.

Having read the reasons to choose another package, you may wonder why you should consider Python.

• You need a language which can act as an end-to-end solution that allows access to web-based services,
database servers, data management and processing and statistical computation. Python can even be used
to write server-side apps such as a dynamic website (see e.g. http://stackoverflow.com), apps
for desktop-class operating systems with graphical user interfaces, or apps for tablets and phones apps
(iOS and Android).

• Data handling and manipulation – especially cleaning and reformatting – is an important concern. Python
is substantially more capable at data set construction than either R or MATLAB.

• Performance is a concern, but not at the top of the list.2

• Free is an important consideration – Python can be freely deployed, even to 100s of servers in on a
cloud-based cluster (e.g. Amazon Web Services, Google Compute or Azure).

• Knowledge of Python, as a general purpose language, is complementary to R/MATLAB/Julia/Ox/-


GAUSS/Stata.

1.2 Conventions
These notes will follow two conventions.

1. Code blocks will be used throughout.


"""A docstring
"""

# Comments appear in a different color

# Reserved keywords are highlighted


and as assert break class continue def del elif else
except exec finally for from global if import in is
lambda not or pass print raise return try while with yield

# Common functions and classes are highlighted in a


# different color. Note that these are not reserved,
# and can be used although best practice would be
# to avoid them if possible
array range list True False None

# Long lines are indented


some_text = 'This is a very, very, very, very, very, very, very, very, very, very,
very, very long line.'

2. When a code block contains >>>, this indicates that the command is running an interactive IPython
session. Output will often appear after the console command, and will not be preceded by a command
indicator.
2
Python performance can be made arbitrarily close to C using a variety of methods, including numba (pure python), Cython
(C/Python creole language) or directly calling C code. Moreover, recent advances have substantially closed the gap with respect to
other Just-in-Time compiled languages such as MATLAB.
1.3 Important Components of the Python Scientific Stack 3

>>> x = 1.0
>>> x + 2
3.0

If the code block does not contain the console session indicator, the code contained in the block is
intended to be executed in a standalone Python file.
import numpy as np

x = np.array([1,2,3,4])
y = np.sum(x)
print(x)
print(y)

1.3 Important Components of the Python Scientific Stack


1.3.1 Python
Python 3.6 (or later) is required, and Python 3.8 (the latest release) is recommended. This provides the core
Python interpreter.

1.3.2 NumPy
NumPy provides a set of array data types which are essential for statistics, econometrics and data analysis.

1.3.3 SciPy
SciPy contains a large number of routines needed for analysis of data. The most important include a wide range
of random number generators, linear algebra routines, and optimizers. SciPy depends on NumPy.

1.3.4 Jupyter and IPython


IPython provides an interactive Python environment which enhances productivity when developing code or
performing interactive data analysis. Jupyter provides a generic set of infrastructure that enables IPython to be
run in a variety of settings including an improved console (QtConsole) or in an interactive web-browser based
notebook.

1.3.5 matplotlib and seaborn


matplotlib provides a plotting environment for 2D plots, with limited support for 3D plotting. seaborn is a
Python package that improves the default appearance of matplotlib plots without any additional code.

1.3.6 pandas
pandas provides high-performance data structures and is essential when working with data.

1.3.7 statsmodels
statsmodels is pandas-aware and provides models used in the statistical analysis of data including linear regres-
sion, Generalized Linear Models (GLMs), and time-series models (e.g., ARIMA).
4 Introduction

1.3.8 Performance Modules


A number of modules are available to help with performance. These include Cython and Numba. Cython is a
Python module which facilitates using a Python-like language to write functions that can be compiled to native
(C code) Python extensions. Numba uses a method of just-in-time compilation to translate a subset of Python
to native code using Low-Level Virtual Machine (LLVM).

1.4 Setup
The recommended method to install the Python scientific stack is to use Continuum Analytics’ Anaconda.
Appendix ?? describes a more complex installation procedure with instructions for directly installing Python
and the required modules when it is not possible to install Anaconda.

Continuum Analytics’ Anaconda


Anaconda, a free product of Continuum Analytics (www.continuum.io), is a virtually complete scientific
stack for Python. It includes both the core Python interpreter and standard libraries as well as most modules
required for data analysis. Anaconda is free to use and modules for accelerating the performance of linear alge-
bra on Intel processors using the Math Kernel Library (MKL) are provided. Continuum Analytics also provides
other high-performance modules for reading large data files or using the GPU to further accelerate performance
for an additional, modest charge. Most importantly, installation is extraordinarily easy on Windows, Linux, and
OS X. Anaconda is also simple to update to the latest version using

conda update conda


conda update anaconda

Windows

Installation on Windows requires downloading the installer and running. Anaconda comes in both Python
2.7 and 3.x flavors, and the latest Python 3.x is required. These instructions use ANACONDA to indicate
the Anaconda installation directory (e.g., the default is C:\Anaconda). Once the setup has completed, open a
PowerShell command prompt and run
cd ANACONDA\Scripts
conda init powershell
conda update conda
conda update anaconda
conda install html5lib seaborn jupyterlab

which will first ensure that Anaconda is up-to-date. conda install can be used later to install other packages
that may be of interest. Note that if Anaconda is installed into a directory other than the default, the full path
should not contain Unicode characters or spaces.

Notes

The recommended settings for installing Anaconda on Windows are:

• Install for all users, which requires admin privileges. If these are not available, then choose the “Just
for me” option, but be aware of installing on a path that contains non-ASCII characters which can cause
issues.
1.5 Using Python 5

• Run conda init powershell to ensure that Anaconda commands can be run from the PowerShell
prompt.

• Register Anaconda as the system Python unless you have a specific reason not to (unlikely).

Linux and OS X

Installation on Linux requires executing


bash Anaconda3-x.y.z-Linux-ISA.sh

where x.y.z will depend on the version being installed and ISA will be either x86 or more likely x86_64.
Anaconda comes in both Python 2.7 and 3.x flavors, and the latest Python 3.x is required. The OS X installer is
available either in a GUI installed (pkg format) or as a bash installer which is installed in an identical manner to
the Linux installation. It is strongly recommended that the anaconda/bin is prepended to the path. This can be
performed in a session-by-session basis by entering conda init bash and then restarting your terminal. Note
that other shells such as zsh are also supported, and can be initialized by replacing bash with the name of your
preferred shell.
After installation completes, execute
conda update conda
conda update anaconda
conda install html5lib seaborn jupyterlab

which will first ensure that Anaconda is up-to-date and then install some optional modules. conda install
can be used later to install other packages that may be of interest.

Notes

All instructions for OS X and Linux assume that conda init bash has been run. If this is not the case, it is
necessary to run

cd ANACONDA
cd bin

and then all commands must be prepended by a . as in

./conda update conda

1.5 Using Python


Python can be programmed using an interactive session using IPython or by directly executing Python scripts
– text files that end with the extension .py – using the Python interpreter.

1.5.1 Python and IPython


Most of this introduction focuses on interactive programming, which has some distinct advantages when learn-
ing a language. The standard Python interactive console is very basic and does not support useful features such
as tab completion. IPython, and especially the QtConsole version of IPython, transforms the console into a
highly productive environment which supports a number of useful features:
6 Introduction

• Tab completion - After entering 1 or more characters, pressing the tab button will bring up a list of
functions, packages, and variables which match the typed text. If the list of matches is large, pressing tab
again allows the arrow keys can be used to browse and select a completion.
• “Magic” function which make tasks such as navigating the local file system (using %cd ~/directory/
or just cd ~/directory/ assuming that %automagic is on) or running other Python programs (using
run program.py) simple. Entering %magic inside and IPython session will produce a detailed
description of the available functions. Alternatively, %lsmagic produces a succinct list of available
magic commands. The most useful magic functions are

– cd - change directory
– edit filename - launch an editor to edit filename
– ls or ls pattern - list the contents of a directory
– run filename - run the Python file filename
– timeit - time the execution of a piece of code or function
– history - view commands recently run. When used with the -l switch, the history of previous ses-
sions can be viewed (e.g., history -l 100 will show the most recent 100 commands irrespective
of whether they were entered in the current IPython session of a previous one).

• Integrated help - When using the QtConsole, calling a function provides a view of the top of the help
function. For example, entering mean( will produce a view of the top 20 lines of its help text.
• Inline figures - Both the QtConsole and the notebook can also display figure inline which produces a
tidy, self-contained environment. This can be enabled by entering %matplotlib inline in an IPython
session.
• The special variable _ contains the last result in the console, and so the most recent result can be saved
to a new variable using the syntax x = _.
• Support for profiles, which provide further customization of sessions.

1.5.2 Launching IPython


OS X and Linux

IPython can be started by running


ipython

in the terminal. IPython using the QtConsole can be started using


jupyter qtconsole

A single line launcher on OS X or Linux can be constructed using


bash -c "jupyter qtconsole"

This single line launcher can be saved as filename.command where filename is a meaningful name (e.g. IPython-
Terminal) to create a launcher on OS X by entering the command
chmod 755 /FULL/PATH/TO/filename.command

The same command can to create a Desktop launcher on Ubuntu by running


sudo apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new

and then using the command as the Command in the dialog that appears.
1.5 Using Python 7

Figure 1.1: IPython running in the Windows Terminal app.

Windows (Anaconda)

To run IPython open PowerShell and enter IPython in the start menu. Starting IPython using the QtConsole
is similar and is simply called QtConsole in the start menu. Launching IPython from the start menu should
create a window similar to that in figure 1.1.
Next, run

jupyter qtconsole --generate-config

in the terminal or command prompt to generate a file named jupyter_qtconsole_config.py. This file contains
settings that are useful for customizing the QtConsole window. A few recommended modifications are

c.ConsoleWidget.font_size = 12
c.ConsoleWidget.font_family = "Bitstream Vera Sans Mono"
c.JupyterWidget.syntax_style = "monokai"

These commands assume that the Bitstream Vera fonts have been locally installed, which are available from
http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/. Opening Qt-
Console should create a window similar to that in figure 1.2 (although the appearance might differ) if you
did not use the recommendation configuration.

1.5.3 Getting Help


Help is available in IPython sessions using help(function). Some functions (and modules) have very long help
files. When using IPython, these can be paged using the command ?function or function? so that the text can be
scrolled using page up and down and q to quit. ??function or function?? can be used to type the entire function
including both the docstring and the code.

1.5.4 Running Python programs


While interactive programming is useful for learning a language or quickly developing some simple code,
complex projects require the use of complete programs. Programs can be run either using the IPython magic
8 Introduction

Figure 1.2: IPython running in a QtConsole session.

work %run program.py or by directly launching the Python program using the standard interpreter using
python program.py. The advantage of using the IPython environment is that the variables used in the
program can be inspected after the program run has completed. Directly calling Python will run the program
and then terminate, and so it is necessary to output any important results to a file so that they can be viewed
later.3
To test that you can successfully execute a Python program, input the code in the block below into a text
file and save it as firstprogram.py.
# First Python program
import time

print("Welcome to your first Python program.")


input("Press enter to exit the program.")
print("Bye!")
time.sleep(2)

Once you have saved this file, open the console, navigate to the directory you saved the file and enter python
firstprogram.py. Finally, run the program in IPython by first launching IPython, and the using %cd to
change to the location of the program, and finally executing the program using %run firstprogram.py.

1.5.5 %pylab and %matplotlib


When writing Python code, only a small set of core functions and variable types are available in the interpreter.
The standard method to access additional variable types or functions is to use imports, which explicitly al-
low access to specific packages or functions. While it is best practice to only import required functions or
packages, there are many functions in multiple packages that are commonly encountered in these notes. Pylab
is a collection of common NumPy, SciPy and Matplotlib functions that can be easily imported using a single
command in an IPython session, %pylab. This is nearly equivalent to calling from pylab import ⁎, since it
also sets the backend that is used to draw plots. The backend can be manually set using %pylab backend where
3
Programs can also be run in the standard Python interpreter using the command:
exec(compile(open(’filename.py’).read(),’filename.py’,’exec’))
1.5 Using Python 9

Figure 1.3: A successful test that matplotlib, IPython, NumPy and SciPy were all correctly installed.

backend is one of the available backends (e.g., qt5 or inline). Similarly %matplotlib backend can be used to
set just the backend without importing all of the modules and functions come with %pylab .
Most chapters assume that %pylab has been called so that functions provided by NumPy can be called
without explicitly importing them.

1.5.6 Testing the Environment


To make sure that you have successfully installed the required components, run IPython using shortcut or by
running ipython or jupyter qtconsole run in a terminal window. Enter the following commands,
one at a time (the meaning of the commands will be covered later in these notes).
>>> %pylab qt5
>>> x = randn(100,100)
>>> y = mean(x,0)
>>> import seaborn
>>> plot(y)
>>> import scipy as sp

If everything was successfully installed, you should see something similar to figure 1.3.

1.5.7 jupyterlab notebooks


A jupyter notebook is a simple and useful method to share code with others. Notebooks allow for a fluid
synthesis of formatted text, typeset mathematics (using LATEX via MathJax) and Python. The primary method
for using notebooks is through a web interface, which allows creation, deletion, export and interactive editing
of notebooks.
10 Introduction

Figure 1.4: The default IPython Notebook screen showing two notebooks.

To launch the jupyterlab server, open a command prompt or terminal and enter

jupyter lab

This command will start the server and open the default browser which should be a modern version of Chrome
(preferable), Chromium, Firefox or Edge. If the default browser is Safari or Internet Explorer, the URL can
be copied and pasted into Chrome. The first screen that appears will look similar to figure 1.4, except that the
list of notebooks will be empty. Clicking on New Notebook will create a new notebook, which, after a bit of
typing, can be transformed to resemble figure 1.5. Notebooks can be imported by dragging and dropping and
exported from the menu inside a notebook.

1.5.8 Integrated Development Environments


As you progress in Python and begin writing more sophisticated programs, you will find that using an Integrated
Development Environment (IDE) will increase your productivity. Most contain productivity enhancements
such as built-in consoles, code completion (or IntelliSense, for completing function names) and integrated
debugging. Discussion of IDEs is beyond the scope of these notes, although Spyder is a reasonable choice
(free, cross-platform). Visual Studio Code is an excellent alternative. My preferred IDE is PyCharm, which has
a community edition that is free for use (the professional edition is low cost for academics).

spyder

spyder is an IDE specialized for use in scientific applications of Python rather than for general purpose applica-
tion development. This is both an advantage and a disadvantage when compared to a full featured IDE such as
PyCharm or VS Code. The main advantage is that many powerful but complex features are not integrated into
Spyder, and so the learning curve is much shallower. The disadvantage is similar - in more complex projects,
or if developing something that is not straight scientific Python, Spyder is less capable. However, netting these
1.6 Exercises 11

Figure 1.5: A jupyterlab notebook showing formatted markdown, LATEX math and cells containing code.

two, Spyder is almost certainly the IDE to use when starting Python, and it is always relatively simple to migrate
to a sophisticated IDE if needed.
Spyder is started by entering spyder in the terminal or command prompt. A window similar to that in
figure 1.6 should appear. The main components are the editor (1), the object inspector (2), which dynamically
will show help for functions that are used in the editor, and the console (3). By default, Spyder opens a standard
Python console, although it also supports using the more powerful IPython console. The object inspector
window, by default, is grouped with a variable explorer, which shows the variables that are in memory and the
file explorer, which can be used to navigate the file system. The console is grouped with an IPython console
window (needs to be activated first using the Interpreters menu along the top edge), and the history log which
contains a list of commands executed. The buttons along the top edge facilitate saving code, running code and
debugging.

1.6 Exercises
1. Install Python.
2. Test the installation using the code in section 1.5.6.
3. Customize IPython QtConsole using a font or color scheme. More customization options can be found
by running ipython -h.
4. Explore tab completion in IPython by entering a<TAB> to see the list of functions which start with a and
are loaded by pylab. Next try i<TAB>, which will produce a list longer than the screen – press ESC to
exit the pager.
5. Launch IPython Notebook and run code in the testing section.
6. Open Spyder and explore its features.
12 Introduction

Figure 1.6: The default Spyder IDE on Windows.

1.A Additional Installation Issues


1.A.1 Frequently Encountered Problems
All
Whitespace sensitivity

Python is whitespace sensitive and so indentation, either spaces or tabs, affects how Python interprets files. The
configuration files, e.g. ipython_config.py, are plain Python files and so are sensitive to whitespace. Introducing
white space before the start of a configuration option will produce an error, so ensure there is no whitespace
before active lines of a configuration.

Windows
Spaces in path

Python may work when directories have spaces.

Unicode in path

Python does not always work well when a path contains Unicode characters, which might occur in a user
name. While this isn’t an issue for installing Python or Anaconda, it is an issue for IPython which looks
in c:\user\username\.ipython for configuration files. The solution is to define the HOME variable before
launching IPython to a path that has only ASCII characters.

mkdir c:\anaconda\ipython_config
set HOME=c:\anaconda\ipython_config
1.A Additional Installation Issues 13

c:\Anaconda\Scripts\activate econometrics
ipython profile create econometrics
ipython --profile=econometrics

The set HOME=c:\anaconda\ipython_config can point to any path with directories containing only ASCII
characters, and can also be added to any batch file to achieve the same effect.

OS X
Installing Anaconda to the root of the partition

If the user account used is running as root, then Anaconda may install to /anaconda and not ~/anaconda by
default. Best practice is not to run as root, although in principle this is not a problem, and /anaconda can be
used in place of ~/anaconda in any of the instructions.

1.A.2 Setup using Virtual Environments


The simplest method to install the Python scientific stack is to use directly Continuum Analytics’ Anaconda.
These instructions describe alternative installation options using virtual environments, which allow alternative
configurations to simultaneously co-exist on a single system. The primary advantage of a virtual environment
is that it allows package versions to be frozen so that code that upgrading a module or all of Anaconda does not
upgrade the packages in a particular virtual environment.

Windows

Installation on Windows requires downloading the installer and running. These instructions use ANACONDA
to indicate the Anaconda installation directory (e.g. the default is C:\Anaconda). Once the setup has completed,
open a PowerShell prompt and run
cd ANACONDA\Scripts
conda init powershell
conda update conda
conda update anaconda
conda create -n econometrics qtconsole notebook matplotlib numpy pandas scipy spyder
statsmodels
conda install -n econometrics cython lxml nose numba numexpr pytables sphinx xlrd xlwt
html5lib seaborn

which will first ensure that Anaconda is up-to-date and then create a virtual environment named economet-
rics. Using a virtual environment is a best practice and is important since component updates can lead to
errors in otherwise working programs due to backward incompatible changes in a module. The long list of
modules in the conda create command includes the core modules. conda install contains the remain-
ing packages and is shown as an example of how to add packages to an existing virtual environment af-
ter it has been created. It is also possible to install all available Anaconda packages using the command
conda create -n econometrics anaconda.
The econometrics environment must be activated before use. This is accomplished by running
conda activate econometrics

from the command prompt, which prepends [econometrics] to the prompt as an indication that virtual environ-
ment is active. Activate the econometrics environment and then run
cd c:\
ipython
14 Introduction

which will open an IPython session using the newly created virtual environment.
Virtual environments can also be created using specific versions of packages using pinning. For example,
to create a virtual environment names old using Python 3.6 and NumPy 1.16,

conda create -n old python=3.6 numpy=1.16 scipy pandas

which will install the requested versions of Python and NumPy as well as the latest version of SciPy and pandas
that are compatible with the pinned versions.

Linux and OS X

Installation on Linux requires executing


bash Anaconda3-x.y.z-Linux-ISA.sh

where x.y.z will depend on the version being installed and ISA will be either x86 or more likely x86_64. The
OS X installer is available either in a GUI installed (pkg format) or as a bash installer which is installed in an
identical manner to the Linux installation. After installation completes, change to the folder where Anaconda
installed (written here as ANACONDA, default ~/anaconda) and execute
cd ANACONDA
cd bin
./conda init bash
./conda update conda
./conda update anaconda
./conda create -n econometrics qtconsole notebook matplotlib numpy pandas scipy spyder
statsmodels
./conda install -n econometrics cython lxml nose numba numexpr pytables sphinx xlrd xlwt
html5lib seaborn

which will first ensure that Anaconda is up-to-date and then create a virtual environment named econometrics
with the required packages. conda create creates the environment and conda install installs additional
packages to the existing environment. conda install can be used later to install other packages that may be
of interest. To activate the newly created environment, run
conda activate econometrics

and then run the command


ipython

to launch IPython using the newly created virtual environment.


Chapter 2

Built-in Data Types

Before diving into Python for analyzing data or running Monte Carlos, it is necessary to understand some basic
concepts about the core Python data types. Unlike domain-specific languages such as MATLAB or R, where
the default data type has been chosen for numerical work, Python is a general purpose programming language
which is also well suited to data analysis, econometrics, and statistics. For example, the basic numeric type in
MATLAB is an array (using double precision, which is useful for floating point mathematics), while the basic
numeric data type in Python is a 1-dimensional scalar which may be either an integer or a double-precision
floating point, depending on the formatting of the number when input.

2.1 Variable Names


Variable names can take many forms, although they can only contain numbers, letters (both upper and lower),
and underscores (_). They must begin with a letter or an underscore and are CaSe SeNsItIve. Additionally,
some words are reserved in Python and so cannot be used for variable names (e.g. import or for). For example,
x = 1.0
X = 1.0
X1 = 1.0
X1 = 1.0
x1 = 1.0
dell = 1.0
dellreturns = 1.0
dellReturns = 1.0
_x = 1.0
x_ = 1.0

are all legal and distinct variable names. Note that names which begin or end with an underscore, while legal,
are not normally used since by convention these convey special meaning.1 Illegal names do not follow these
rules.
# Not allowed
x: = 1.0
1X = 1
X-1 = 1
for = 1
1
Variable names with a single leading underscore, for example _some_internal_value, indicate that the variable is for internal
use by a module or class. While indicated to be private, this variable will generally be accessible by calling code. Double leading
underscores, for example __some_private_value, indicate that a value is actually private and is not accessible. Variable names
with trailing underscores are used to avoid conflicts with reserved Python words such as class_ or lambda_. Double leading and
trailing underscores are reserved for “magic” variable (e.g. __init__) , and so should be avoided except when specifically accessing
a feature.
16 Built-in Data Types

Multiple variables can be assigned on the same line using commas,


x, y, z = 1, 3.1415, 'a'

2.2 Core Native Data Types


2.2.1 Numeric
Simple numbers in Python can be either integers, floats or complex. This chapter does not cover all Python data
types and instead focuses on those which are most relevant for numerical analysis, econometrics, and statistics.
The byte, bytearray and memoryview data types are not described.

2.2.1.1 Floating Point (float)

The most important (scalar) data type for numerical analysis is the float. Unfortunately, not all non-complex
numeric data types are floats. To input a floating data type, it is necessary to include a . (period, dot) in the
expression. This example uses the function type() to determine the data type of a variable.
>>> x = 1
>>> type(x)
int

>>> x = 1.0
>>> type(x)
float

>>> x = float(1)
>>> type(x)
float

This example shows that using the expression that x = 1 produces an integer-valued variable while x = 1.0
produces a float-valued variable. Using integers can produce unexpected results and so it is important to include
“.0” when expecting a float.

2.2.1.2 Complex (complex)

Complex numbers are also important for numerical analysis. Complex numbers are created in Python using j
or the function complex().
>>> x = 1.0
>>> type(x)
float

>>> x = 1j
>>> type(x)
complex

>>> x = 2 + 3j
>>> x
(2+3j)

>>> x = complex(1)
>>> x
(1+0j)

Note that a+bj is the same as complex(a,b), while complex(a) is the same as a+0j.
2.2 Core Native Data Types 17

2.2.1.3 Integers (int)

Floats use an approximation to represent numbers which may contain a decimal portion. The integer data
type stores numbers using an exact representation, so that no approximation is needed. The cost of the exact
representation is that the integer data type cannot express anything that isn’t an integer, rendering integers of
limited use in most numerical work.
Basic integers can be entered either by excluding the decimal (see float), or explicitly using the int()
function. The int() function can also be used to convert a float to an integer by round towards 0.
>>> x = 1
>>> type(x)
int

>>> x = 1.0
>>> type(x)
float

>>> x = int(x)
>>> type(x)
int

Python integers support have unlimited range since the amount of bits used to store an integer is dynamic.
>>> x = 1
>>> x
1

>>> type(x)
int

>>> x = 2 ⁎⁎ 127 + 2 ⁎⁎ 65 # ⁎⁎ is denotes exponentiation, y^64 in TeX


>>> x
170141183460469231768580791863303208960

2.2.2 Boolean (bool)

The Boolean data type is used to represent true and false, using the reserved keywords True and False. Boolean
variables are important for program flow control (see Chapter 12) and are typically created as a result of logical
operations (see Chapter 10), although they can be entered directly.
>>> x = True
>>> type(x)
bool

>>> x = bool(1)
>>> x
True

>>> x = bool(0)
>>> x
False

Non-zero, non-empty values generally evaluate to true when evaluated by bool(). Zero or empty values such
as bool(0), bool(0.0), bool(0.0j), bool(None), bool('') and bool([]) are all false.
18 Built-in Data Types

2.2.3 Strings (str)


Strings are not usually important for numerical analysis, although they are frequently encountered when dealing
with data files, especially when importing or when formatting output for human consumption. Strings are
delimited using single quotes ('') or double quotes ("") but not using combination of the two delimiters (i.e.,
do not use '") in a single string, except when used to express a quotation.
>>> x = 'abc'
>>> type(x)
str

>>> y = '"A quotation!"'


>>> print(y)
"A quotation!"

String manipulation is further discussed in Chapter 23.

2.2.3.1 Slicing Strings

Substrings within a string can be accessed using slicing. Slicing uses [] to contain the indices of the characters
in a string, where the first index is 0, and the last is n − 1 (assuming the string has n letters). The following
table describes the types of slices which are available. The most useful are s[i], which will return the character
in position i, s[:i], which return the leading characters from positions 0 to i − 1, and s[i:] which returns the
trailing characters from positions i to n − 1. The table below provides a list of the types of slices which can
be used. The second column shows that slicing can use negative indices which essentially index the string
backward.

Slice Behavior
s[:] Entire string
s[i] Charactersi
s[i:] Charactersi, . . . , n − 1
s[:i] Characters0, . . . , i − 1
s[i: j ] Charactersi, . . . , j − 1
s[i: j :m] Charactersi,i + m,. . .i + m⌊ j−i−1
m ⌋
s[−i] Characters n − i
s[−i:] Charactersn − i, . . . , n − 1
s[:−i] Characters0, . . . , n − i − 1
s[− j :−i] Characters n − j, . . . , n − i − 1, − j < −i
s[− j :−i:m] Characters n − j,n − j + m,. . .,n − j + m⌊ j−i−1
m ⌋

>>> text = 'Python strings are sliceable.'


>>> text[0]
'P'

>>> text[10]
'i'

>>> L = len(text)
>>> text[L] # Error
IndexError: string index out of range

>>> text[L-1]
2.2 Core Native Data Types 19

'.'

>>> text[:10]
'Python str'

>>> text[10:]
'ings are sliceable.'

2.2.4 Lists (list)

Lists are a built-in container data type which hold other data. A list is a collection of other objects – floats,
integers, complex numbers, strings or even other lists. Lists are essential to Python programming and are used
to store collections of other values. For example, a list of floats can be used to express a vector (although the
NumPy data type array is better suited to working with collections of numeric values). Lists also support
slicing to retrieve one or more elements. Basic lists are constructed using square braces, [], and values are
separated using commas.

>>> x = []
>>> type(x)
builtins.list

>>> x=[1,2,3,4]
>>> x
[1,2,3,4]

# 2-dimensional list (list of lists)


>>> x = [[1,2,3,4], [5,6,7,8]]
>>> x
[[1, 2, 3, 4], [5, 6, 7, 8]]

# Jagged list, not rectangular


>>> x = [[1,2,3,4] , [5,6,7]]
>>> x
[[1, 2, 3, 4], [5, 6, 7]]

# Mixed data types


>>> x = [1,1.0,1+0j,'one',None,True]
>>> x
[1, 1.0, (1+0j), 'one', None, True]

These examples show that lists can be regular, nested and can contain any mix of data types including other
lists.

2.2.4.1 Slicing Lists

Lists, like strings, can be sliced. Slicing is similar, although lists can be sliced in more ways than strings. The
difference arises since lists can be multi-dimensional while strings are always 1×n. Basic list slicing is identical
to slicing strings, and operations such as x[:], x[1:], x[:1] and x[-3:] can all be used. To understand slicing,
assume x is a 1-dimensional list with n elements and i ≥ 0, j > 0, i < j,m ≥ 1. Python uses 0-based indices, and
so the n elements of x can be thought of as x0 , x1 , . . . , xn−1 .
20 Built-in Data Types

Slice Behavior, Slice Behavior


x[:] Return all x x[−i] Returns xn−i except when i = −0
x[i] Return xi x[−i:] Return xn−i , . . . , xn−1
x[i:] Return xi , . . . xn−1 x[:−i] Return x0 , . . . , xn−i−1
x[:i] Return x0 , . . . , xi−1 x[− j:−i] Return xn− j , . . . , xn−i−1
x[i: j] Return xi , xi+1 , . . . x j−1 x[− j:−i:m] Returns xn− j ,xn− j+m ,. . .,xn− j+m⌊ j−i−1 ⌋
m
x[i: j:m] Returns xi ,xi+m ,. . .xi+m⌊ j−i−1 ⌋
m

The default list slice uses a unit stride (step size of one) . It is possible to use other strides using a third
input in the slice so that the slice takes the form x[i:j:m] where i is the index to start, j is the index to end
(exclusive) and m is the stride length. For example x[::2] will select every second element of a list and is
equivalent to x[0:n:2] where n = len(x). The stride can also be negative which can be used to select the
elements of a list in reverse order. For example, x[::-1] will reverse a list and is equivalent to x[0:n:-1] .
Examples of accessing elements of 1-dimensional lists are presented below.
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> x[0]
0
>>> x[5]
5
>>> x[10] # Error
IndexError: list index out of range
>>> x[4:]
[4, 5, 6, 7, 8, 9]
>>> x[:4]
[0, 1, 2, 3]
>>> x[1:4]
[1, 2, 3]
>>> x[-0]
0
>>> x[-1]
9
>>> x[-10:-1]
[0, 1, 2, 3, 4, 5, 6, 7, 8]

List can be multidimensional, and slicing can be done directly in higher dimensions. For simplicity, consider
slicing a 2-dimensional list x = [[1,2,3,4], [5,6,7,8]]. If single indexing is used, x[0] will return the
first (inner) list, and x[1] will return the second (inner) list. Since the list returned by x[0] is sliceable, the
inner list can be directly sliced using x[0][0] or x[0][1:4].
>>> x = [[1,2,3,4], [5,6,7,8]]
>>> x[0]
[1, 2, 3, 4]
>>> x[1]
[5, 6, 7, 8]
>>> x[0][0]
1
>>> x[0][1:4]
[2, 3, 4]
>>> x[1][-4:-1]
[5, 6, 7]

2.2.4.2 List Functions

A number of functions are available for manipulating lists. The most useful are
2.2 Core Native Data Types 21

Function Method Description


list.append(x,value) x.append(value) Appends value to the end of the list.
len(x) – Returns the number of elements in the list.
list.extend(x,list) x.extend(list) Appends the values in list to the existing list.2
list.pop(x,index) x.pop(index) Removes the value in position index and returns the value.
list.remove(x,value) x.remove(value) Removes the first occurrence of value from the list.
list.count(x,value) x.count(value) Counts the number of occurrences of value in the list.
del x[slice] Deletes the elements in slice.

>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> x.append(0)
>>> x
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

>>> len(x)
11

>>> x.extend([11,12,13])
>>> x
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12, 13]

>>> x.pop(1)
1

>>> x
[0, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12, 13]

>>> x.remove(0)
>>> x
[2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12, 13]

Elements can also be deleted from lists using the keyword del in combination with a slice.
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> del x[0]
>>> x
[1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> x[:3]
[1, 2, 3]

>>> del x[:3]


>>> x
[4, 5, 6, 7, 8, 9]

>>> del x[1:3]


>>> x
[4, 7, 8, 9]

>>> del x[:]


>>> x
[]

2.2.5 Tuples (tuple)


A tuple is virtually identical to a list with one important difference – tuples are immutable. Immutability means
that a tuple cannot be changed once created. It is not possible to add, remove, or replace elements in a tuple.
22 Built-in Data Types

However, if a tuple contains a mutable data type, for example a tuple that contains a list, the contents mutable
data type can be altered.
Tuples are constructed using parentheses (()) in place of the square brackets ([]) used to create lists. Tuples
can be sliced in an identical manner as lists. A list can be converted into a tuple using tuple() (Similarly, a
tuple can be converted to list using list()).
>>> x =(0,1,2,3,4,5,6,7,8,9)
>>> type(x)
tuple

>>> x[0]
0

>>> x[-10:-5]
(0, 1, 2, 3, 4)

>>> x = list(x)
>>> type(x)
list

>>> x = tuple(x)
>>> type(x)
tuple

>>> x= ([1,2],[3,4])
>>> x[0][1] = -10
>>> x # Contents can change, elements cannot
([1, -10], [3, 4])

Note that tuples containing a single element must contain a comma when created, so that x = (2,) is assign
a tuple to x, while x=(2) will assign 2 to x. The latter interprets the parentheses as if they are part of a
mathematical formula rather than being used to construct a tuple. x = tuple([2]) can also be used to create a
single element tuple. Lists do not have this issue since square brackets do not have this ambiguity.
>>> x =(2)
>>> type(x)
int

>>> x = (2,)
>>> type(x)
tuple

>>> x = tuple([2])
>>> type(x)
tuple

2.2.5.1 Tuple Functions

Tuples are immutable, and so only have the methods index and count, which behave in an identical manner to
their list counterparts.

2.2.6 Dictionary (dict)


Dictionaries are encountered far less frequently than then any of the previously described data types in numer-
ical Python. They are, however, commonly used to pass options into other functions such as optimizers, and
so familiarity with dictionaries is important. Dictionaries in Python are composed of keys (words) and values
2.2 Core Native Data Types 23

(definitions). Dictionaries keys must be unique immutable data types (e.g. strings, the most common key, in-
tegers, or tuples containing immutable types), and values can contain any valid Python data type.3 Values are
accessed using keys.
>>> data = {'age': 34, 'children' : [1,2], 1: 'apple'}
>>> type(data)
dict

>>> data['age']
34

Values associated with an existing key can be updated by making an assignment to the key in the dictionary.
>>> data['age'] = 'xyz'
>>> data['age']
'xyz'

New key-value pairs can be added by defining a new key and assigning a value to it.
>>> data['name'] = 'abc'
>>> data
{1: 'apple', 'age': 'xyz', 'children': [1, 2], 'name': 'abc'}

Key-value pairs can be deleted using the reserved keyword del.


>>> del data['age']
>>> data
{1: 'apple', 'children': [1, 2], 'name': 'abc'}

2.2.7 Sets (set, frozenset)


Sets are collections which contain all unique elements of a collection. set and frozenset only differ in that the
latter is immutable (and so has higher performance), and so set is similar to a unique list while frozenset
is similar to a unique tuple . While sets are generally not important in numerical analysis, they can be very
useful when working with messy data – for example, finding the set of unique tickers in a long list of tickers.

2.2.7.1 Set Functions

A number of methods are available for manipulating sets. The most useful are
Function Method Description
set.add(x,element) x.add(element) Appends element to a set.
len(x) – Returns the number of elements in the set.
set.difference(x,set) x.difference(set) Returns the elements in x which are not in set.
set.intersection(x,set) x.intersection(set) Returns the elements of x which are also in set.
set.remove(x,element) x.remove(element) Removes element from the set.
set.union(x,set) x.union(set) Returns the set containing all elements of x and set.

The code below demonstrates the use of set. Note that 'MSFT' is repeated in the list used to initialize the
set, but only appears once in the set since all elements must be unique.
>>> x = set(['MSFT','GOOG','AAPL','HPQ','MSFT'])
>>> x
{'AAPL', 'GOOG', 'HPQ', 'MSFT'}

3
Formally dictionary keys must support the __hash__ function, equality comparison and it must be the case that different keys
have different hashes.
24 Built-in Data Types

>>> x.add('CSCO')
>>> x
{'AAPL', 'CSCO', 'GOOG', 'HPQ', 'MSFT'}

>>> y = set(['XOM', 'GOOG'])


>>> x.intersection(y)
{'GOOG'}

>>> x = x.union(y)
>>> x
{'AAPL', 'CSCO', 'GOOG', 'HPQ', 'MSFT', 'XOM'}

>>> x.remove('XOM')
{'AAPL', 'CSCO', 'GOOG', 'HPQ', 'MSFT'}

A frozenset supports the same methods except add and remove.

2.2.8 range
A range is most commonly encountered in a for loop. range(a,b,i) creates the sequences that follows
the pattern a, a + i, a + 2i, . . . , a + (m − 1)i where m = ⌈ b−a
i ⌉. In other words, it find all integers x starting with
a such a ≤ x < b and where two consecutive values are separated by i. range can be called with 1 or two
parameters – range(a,b) is the same as range(a,b,1) and range(b) is the same as range(0,b,1).
>>> x = range(10)
>>> type(x)
range

>>> print(x)
range(0, 10)

>>> list(x)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> x = range(3,10)
>>> list(x)
[3, 4, 5, 6, 7, 8, 9]

>>> x = range(3,10,3)
>>> list(x)
[3, 6, 9]

range is not technically a list, which is why the statement print(x) returns range(0,10). Explicitly
converting with list produces a list which allows the values to be printed. range is technically an iterator
which does not actually require the storage space of a list.

2.3 Additional Container Data Types in the Standard Library


Python includes an extensive standard library that provides many features that extend the core Python language.
Data types in the standard library are always installed alongside the Python interpreter. However, they are not
“built-in” since using one requires an explicit import statement to make a particular data type available. The
standard library is vast and some examples of the included functionality are support for working with dates
(provided by the datetime module, see Chapter 14), functional programming tools (itertools , functools
and operator), tools for accessing the file system (os.path and glob inter alia., see Chapter 24), and support
for interacting with resources on the the internet (urllib and ftplib inter alia.). One of the more useful
modules included in the standard library is the collections module. This module provides a set of specialized
2.3 Additional Container Data Types in the Standard Library 25

container data types that extend the built-in data container data types. Two are particularly useful when working
with data: OrderedDict and defaultdict. Both of these extend the built-in dictionary dict with useful
features.

2.3.1 OrderedDict
When using a standard Python dict, items order is not guaranteed. OrderedDict addresses this frequent short-
coming by retaining a list of the keys inserted into the dictionary in the order in which they have been inserted.
The order is also preserved when deleting keys from an OrderedDict.
>>> from collections import OrderedDict
>>> od = OrderedDict()
>>> od['key1'] = 1
>>> od['key2'] = 'a'
>>> od['key3'] = 'alpha'
>>> plain = dict(od)
>>> print(list(od.keys()))
['key1', 'key2', 'key3']

>>> print(list(plain.keys()))
['key2', 'key1', 'key3']

>>> del od['key1']


>>> print(list(od.keys()))
['key2', 'key3']

>>> od['key1'] = 'some other value'


print(list(od.keys()))
['key2', 'key3', 'key1']

This functionality is particularly useful when iterating over the keys in a dictionary since it guarantees a pre-
dictable order when accessing the keys (see Chapter 12). Recent versions of pandas also respect the order in an
OrderedDict when adding columns to a DataFrame (see Chapter 16).

2.3.2 defaultdict
By default attempting to access a key in a dictionary that does not exist will produce an error. There are
circumstances where this is undesirable, and when a key is encountered that doesn’t exist, a default value
should be added to the dictionary and returns. One particularly useful example of this behavior is when making
keyed lists – that is, grouping like elements according to a key in a list. If the key exists, the elements should
be appended to the existing list. If the key doesn’t exist, the key should be added and a new list containing the
new element should be inserted into the disctionary. defaultdict enables this exact scenario by accepting a
callable function as an argument. When a key is found, it behaved just like a standard dictionary. When a key
isn’t found, the output of the callable function is assigned to the key. This example uses list to add a new list
whenever a key is not found.
>>> d = {}
>>> d['one'].append('an item') # Error
KeyError: 'one'

>>> from collections import defaultdict


>>> dd = defaultdict(list)
>>> dd['one'].append('first')
>>> dd['one'].append('second')
>>> dd['two'].append('third')
>>> print(dd)
26 Built-in Data Types

defaultdict(<class 'list'>, {'one': ['first', 'second'], 'two': ['third']})

The callable argument provided to defaultdict can be anything that is useful including other containers,
objects that will be initialized the first time called, or an anonymous function (i.e. a function defined using
lambda, see Section 18.4).

2.4 Python and Memory Management


Python uses a highly optimized memory allocation system which attempts to avoid allocating unnecessary
memory. As a result, when one variable is assigned to another (e.g. to y = x), these will actually point to the
same data in the computer’s memory. To verify this, id() can be used to determine the unique identification
number of a piece of data.4
>>> x = 1
>>> y = x
>>> id(x)
82970264

>>> id(y)
82970264

>>> x = 2.0
>>> id(x)
93850568

>>> id(y)
82970264

In the above example, the initial assignment of y = x produced two variables with the same ID. However, once
x was changed, its ID changed while the ID of y did not, indicating that the data in each variable was stored
in different locations. This behavior is both safe and efficient and is common to the basic Python immutable
types: int, float, complex, string, tuple, frozenset and range.

2.4.1 Example: Lists


Lists are mutable and so assignment does not create a copy , and so changes to either variable affect both.
>>> x = [1, 2, 3]
>>> y = x
>>> y[0] = -10
>>> y
[-10, 2, 3]

>>> x
[-10, 2, 3]

Slicing a list creates a copy of the list and any immutable types in the list – but not mutable elements in the list.
>>> x = [1, 2, 3]
>>> y = x[:]
>>> id(x)
86245960

>>> id(y)
86240776

4
The ID numbers on your system will likely differ from those in the code listing.
2.5 Exercises 27

To see that the inner lists are not copied, consider the behavior of changing one element in a nested list.
>>> x=[[0,1],[2,3]]
>>> y = x[:]
>>> y
[[0, 1], [2, 3]]

>>> id(x[0])
117011656

>>> id(y[0])
117011656

>>> x[0][0]
0.0

>>> id(x[0][0])
30390080

>>> id(y[0][0])
30390080

>>> y[0][0] = -10.0


>>> y
[[-10.0, 1], [2, 3]]

>>> x
[[-10.0, 1], [2, 3]]

When lists are nested or contain other mutable objects (which do not copy), slicing copies the outermost list to
a new ID, but the inner lists (or other objects) are still linked. In order to copy nested lists, it is necessary to
explicitly call deepcopy(), which is in the module copy.
>>> import copy as cp
>>> x=[[0,1],[2,3]]
>>> y = cp.deepcopy(x)
>>> y[0][0] = -10.0
>>> y
[[-10.0, 1], [2, 3]]

>>> x
[[0, 1], [2, 3]]

2.5 Exercises
1. Enter the following into Python, assigning each to a unique variable name:

(a) 4
(b) 3.1415
(c) 1.0
(d) 2+4j
(e) 'Hello'
(f) 'World'

2. What is the type of each variable? Use type if you aren’t sure.
Other documents randomly have
different content
edde-stede, Bettstelle.
edde-vrouwe, Bettgenossin.
edde-war, Bettzeug.
ede, f. 1. Bitte, Gebet. 2. Abgabe (erst erbeten, dann üblich, zuletzt
pflichtmässig geleistet). 3. ein Bitt-, Almosenbrett?
ede (beide), n. Gebiet, districtus, jurisdictio.
ede-bôk, Gebet-Buch.
ede-brêf, Bitt-brief, Empfehlungsschreiben.
edechte = bedochte, bedorfte, s. bedorven.
edechtich, eingedenk.
e-dechtliken, im Gedächtnis, memoriter.
edecht-, bedachtnisse, Gedächtnis, Andenken.
edeck (m. u. n.) und bedeckels, Decke, Umhüllung.
e-decken, mit einer Decke, Umhüllung versehen; verdecken. Bildlich:
beschützen.
e-deckinge, Verhüllung; bildlich: Verstellung.
e-dedingen, -dadingen, s. be-degedingen.
e-degedinge, Verhandlung, placitatio; gerichtliche Anklage.
e-degedingen, -dagedingen, -dachtingen, 1. verabreden,
unterhandeln, placitare, durch Unterhandlung festsetzen. 2. durch
Vertrag mit einschliessen. 3. auf einen Tag vorladen vor Gericht,
anklagen, gerichtlich belangen.
édeger, bediger (bidiger), m. Gebieter, bes. vom Vorgesetzten eines
Ordenshauses, -gebietes (Gebietiger).
édeken, n. Gebetlein.
ede-korn, Kornabgabe.
edel-bret, Bettel-bret (zum Empfange von Almosen etc. in Kirchen
aufgestellt.)
edel-dach, Bettag. Im Plur. bes. die Bet-, Bittwoche, Kreuzwoche, s.
cruce-weke.
e-dêlen, teilhaftig machen, begaben.
édelen, sw. v. betteln.
edeler, m. 1. Beter. 2. Bitter, Bettler.
edel-gelt, Bettel-, Almosengeld.
edelik, erbittlich, exorabilis.
edeliken, adv. flehentlich, suppliciter.
edel-klocke, Betglocke.
edelle = albedelle, s. o.
edel-, bedemisse, Betmesse (um die göttliche Hülfe anzuflehen).
ede-los, frei von bede, Abgabe.
edelt, n. (das Erbettelte), das mit dem Klingelbeutel gesammelte Geld;
der Klingelbeutel.
e-delven, graben (z. B. einen Brunnen etc.).
êden, st. v. 1. bieten, an-, darbieten. 2. gebieten; auch mit Präp. an,
over (bedet over uns, bes. am Schlusse der Briefe). 3. entbieten,
laden. 4. refl. sich erbieten zu etwas.
eden, sw. v. beten; häufig refl.
eden, sw. v. bähen, vgl. begen.
edenk, n. Bedenken, Erwägung.
e-denken, 1. bedenken, erwägen, 2. in Herz und Sinn haben. 3. sich
entsinnen. 4. erdenken, aussinnen. 5. in Verdacht haben. 6. jem. mit
etwas bedenken d. h. beschenken.
e-denkinge, Erwägung, meditatio.
e-denklich, mit Bedacht.
e-dênsthaftich, dienstfertig.
e-dênstlik, dienstbar, familiaris.
ede-paternoster, Rosenkranz.
êder, m. Gebieter, Herr.
eder, m. Beter.
êder, bieder (erst spätniederd.)
ederve (bethereve), bedderve, bedarve, berve, birve, nützlich,
tüchtig, gut, rechtschaffen, gew. von Personen, selten von Sachen.
ederf, -dorf, n. Bedarf, Nutzung.
edervelik, tüchtig, gut, probus.
e-derven, -darven, -dorven, 1. bedürfen, nötig haben. 2. benutzen,
gebrauchen – Prät. auch bedachte, bedochte u. bedechte.
e-derven, berauben, plündern.
e-dervicheit, -derfheit, Tüchtigkeit, Rechtschaffenheit, probitas.
ede-salich, -selich, einer, dessen Bitte erhört wird.
ede-schat, Abgabe, Zahlung einer bede.
ede-stock, Bettelstab.
ede-tafel, Almosenbret = bedelbret.
ede-vart, Bittgang, Wallfahrt.
edi (mhd. bêdiu, bediu), deshalb, weil.
edich, bittend?
edichte, dicht, häufig, heftig, crebro. vgl. gedichte.
e-dichten, 1. erdichten, erfinden, erdenken. 2. in einem Gedichte
verspotten. 3. abfassen, darstellen.
e-dichtenisse, Erdichtung, Erfindung.
e-die, Gedeihen.
e-dien, -digen, gedeihen, gelingen, (gut) ausschlagen; zu etwas
gedeihen, werden; trans. zum Gedeihen, Gelingen bringen.
édinge, das Beten.
e-dingen, 1. verhandeln, durch Verhandlung festsetzen und
bestimmen, placitare. 2. protestieren, appellieren.
e-dinkpalen, sich verwahren, sichern beim Rechtsprechen vor
etwaigen Nachteilen.
edinkstadelen, vor Gericht laden oder stellen.
edochte, Prät. zu be-derven.
e-dôn, bedecken; (euphem.) verunreinigen, bes. refl.
e-doren, bethören, betrügen.
e-doveken, mit Fass-Dauben versehen.
e-doven, schw. v. betäuben.
e-doven, s. beduven.
e-dragen, 1. anklagen (beschmutzen), velschlik b., calumniare. 2. mit
einer Beschuldigung überführen. 3. ertragen?
e-drangsaligen, bedrängen.
e-drank, m. Bedrängung.
e-drêch, m. Betrug.
e-drêchlicheit, Betrüglichkeit.
e-drêchnisse, Betrug.
e-drêchster, Betrüger(in).
e-drêgen, betrügen.
e-drêginge, Betrug.
e-drengen, -drangen, in Drang und Not bringen.
e-drenglik, dringlich, urgens.
e-dreplik, bedeutend, belangreich, gross.
e-drinken, mit einem Trinkgelage besiegeln.
e-driten, bescheissen; bildl. betrügen.
e-drîf, n. Thätigkeit, Betreiben, Geschäft.
e-drive, thätig.
e-driven, betreiben, ausrichten; bewirtschaften (Acker etc.)
e-driven, adj. (= bedrivende), thätig.
e-driverne, der etwas eifrig betreibt, rührig.
e-dropen, betropfen.
e-drovelik, Betrübnis erregend.
e-droven, betrüben.
e-drovenisse, Betrübtheit, Schmerz.
e-drovich, betrübt.
e-druck u. be-druckheit, Bedrücktheit, Not, Angst.
e-drucken, bedrücken.
e-druckenisse, Bedrücktheit, Not.
e-drunten, aufgeschwollen, turgidus.
e-drusemen, ersticken.
e-dude, Deutung.
e-duden, bedeuten, deuten, auslegen.
e-dudenisse, Deutung, Auslegung.
e-duder, Ausleger.
e-duderen?
e-dudinge, Auslegung.
e-duken, eintauchen.
e-dulden, gedulden; aufschieben.
e-dunkeren, dunkel machen; intrans. dunkel werden.
e-duren, refl. beteuern.
edurwerken, sticken, acu pingere.
e-dusen, betäuben.
e-dusinge, Betäubung.
be-duven), überschüttet, bedeckt werden; bes. im Part. bedoven, -
daven, (bes.) von Wasser bedeckt.
e-duvenisse, Überschüttung, Erstickung.
e-dwank, Zwang.
e-dwelen, sich verirren.
e-dwelinge, Verirrung; Irrtum, Ketzerei.
e-dwernachten = over de dwere nacht holden, s. dwernacht.
e-dwingen, zwingen, unterwerfen.
e-dwungeliken, gezwungener Weise.
e-ebben, von der Ebbe überrascht werden, bei der Ebbe
zurückbleiben.
e-eden, -eiden, beeiden, eidlich geloben; einen Eid worauf leisten.
e-egenen, als Eigentum überweisen, vereignen.
e-enxtigen = beanxten.
e-erden, beerdigen.
e-ervedelen (-erfdelen), das Erbteil einziehen, vom Nachlass eines
Hörigen.
e-erven, einen Erben bestellen, zu Erben einsetzen; vererben;
beervet, dem Erbgüter zugefallen sind, der etwas als Erbteil erhalten
hat.
e-ervenen = beerven.
e-ewigen, verewigen, auf immer fest machen.
e-famer, Schmäher, Lästerer.
e-gaddern, sammeln.
e-gaden (zu gade, consors), verheiraten.
e-gaden, 1. bearbeiten, in Stand setzen, ins Werk richten, besorgen,
disponere. 2. bes. den Acker zur Saat zurecht machen, bestellen.
e-gadinge, Bestellung des Ackers.
e-gân, 1. trans. begehen, auf-, über-, an etwas hin und her gehen;
gehend erreichen, betreffen, überfallen; ins Werk setzen, anfangen,
thun; feiern (Feste, bes. Exequien u. Anniversarien). – begân sîn,
bestürzt, verlegen, betroffen sein. 2. refl. (mit Gen. oder von, mit) sich
womit beschäftigen, sich wovon nähren, leben wovon; das Leben
führen.
e-gange, im Gange seiend, s. begenge.
e-gapen, mit offenem Munde begierig und lüstern ansehen, nach
etwas trachten.
e-gasten, Gäste bei jemand einlegen, einquartieren.
e-gavelik, pass. begabt, gelehrig, docilis.
e-gaven, beschenken.
e-gecken, zum Narren, zum Besten haben.
e-geckinge, Verhöhnung.
e-gedelik, passend; s. gadelik.
e-gegenen, -jegenen, -gegen, sw. v. begegnen; widerfahren.
egen sw. v. bähen, feuchtwarme Umschläge machen, befeuchten.
e-gên (= be-jehen), gestehen.
e-genge, gangbar, im Gange seiend; üblich, gewöhnlich.
e-gênisse = begegenisse? was einem begegnet, Schicksal,
Unglücksfall?
e-ger und be-gerte, f. Begierde, Lust, Verlangen.
e-gerich, begierig.
e-geringe, dringender Wunsch.
e-genknisse, Leichenbegängnis; Seelmesse.
e-gerlicheit, Begehr, Bitte; (Gemüts)neigung.
e-gerlik, was begehrt, gewünscht wird, lieblich. 2. begehrend,
dringend.
e-gerliken, dringend. b. bidden.
e-gestigen = begasten.
e-geten, 1. begiessen. 2. beschmieren. 3. eingiessen.
e-geven, 1. trans. verlassen, aufgeben (auch mit Gen.); abs. ins
Kloster geben; erlassen, von sich geben. 2. intrans. hinschwinden,
schwach werden. 3. refl. sich wohin begeben; bes. die Welt verlassen
und in ein Kloster gehen; daher begevene lude, Mönche und Nonnen;
verzichten, verlassen (mit Gen.); sich ergeben; schwach werden,
hinschwinden; sich begeben, sich zutragen.
e-gevinge, das Verlassen der Welt, der Eintritt in ein Kloster etc.
e-gichten, bekennen, zugestehen.
e-gichter, Beichtiger, Beichtvater.
e-gier = be-gere, gere, Saum, Rand, Besatz?
e-giften u. be-giftigen, beschenken, dotieren.
e-giftiger, Beschenker, Stifter, donator.
e-giftinge, Beschenkung.
e-giftnisse = begiftinge.
e-gin, -ginne, n. Anfang.
egine, Begine, Laienschwester.
egine, verschnittenes Mutterschwein.
eginen-konink, Schweinschneidermeister, der über das beginen
(verschneiden) gesetzt ist.
egingin, Dem. zu begine, Beginchen.
e-ginnen, st. v. 1. beginnen, anfangen, unternehmen, mit Gen. u.
Acc., mit Infin. (mit oder ohne to). 2. refl. anfangen.
e-ginner, Urheber, Stifter.
e-ginnisse = begenge-, begenknisse.
e-ginsel, n. Anfang.
e-gissen, Vermutung, Verdacht auf jem. haben; begisset werden, in
Verdacht stehen, verleumdet werden.
e-glinden, mit einem glint (Geländer, Plankenwerk etc.) versehen.
e-gnaden, 1. intr. gnädig sein. 2. trans. begnadigen, beschenken.
e-gnadinge, Begnadung, Beschenkung.
e-gnagen (-knagen), benagen.
e-gnedigen, gnädig gewähren.
e-gnugich, zufrieden.
e-goden (= be-guden), eine Gabe (Gnade etc.) geben.
e-gokelen, Gaukelei treiben, s. be-kochelen.
e-gorden, -gordelen, begürten.
e-gouwen, überschnellen, überlisten.
e-graven, 1. mit Gräben durchziehen; mit Gräben umziehen,
umgeben (bes. zum Zweck der Belagerung einer Stadt); Gräben,
Wälle, Schanzen aufwerfen. 2. begraben, unter die Erde bringen;
bildlich: abmachen, beendigen.
e-gravenisse, Begräbnis.
e-gravinge, Begräbnis.
e-grîp, -grêp, 1. das Ergreifen. 2. Umfang, Gebiet, Bezirk; bildlich:
Vertrag. 3. Absicht, Gedanke; Hinterhalt, Betrug. 4. Tadel (correptio);
sunder b., ohne getadelt zu werden, rechtmässig, irreprehensibilis.
e-gripech, räuberisch, rapax.
e-gripelik, 1. im Stande zu ergreifen. 2. wer oder was zu begrîpen,
tadeln, ist, tadelnswert.
e-gripen, 1. ergreifen, fassen, besetzen; ertappen; betreffen. Vielfach
bildlich, z. B. dat stant b., Stand halten; de were b., sich zur Wehr
setzen, ene klage b., anhängig machen u. a. 2. umfassen,
einschliessen, continere, concludere. 3. in Gedanken ergreifen,
ersinnen, fassen, begreifen. 4. (in Worte) fassen, bestimmen,
concipere. 5. den Umfang festsetzen, gründen. 6. festhalten,
behaupten; mit sineme ede b., eidlich versichern. 7. tadeln, corripere.
– Refl. sik b. mit, handgemein werden, congredi; sik b. an, sich
vergreifen, sich halten an jem. Mit Gen. versprechen, sich anheischig
machen.
e-griper, Tadler, reprehensor.
e-gripinge, das Ergreifen, Beschluss; Feststellung; Anordnung,
Bestimmung; Gründung.
e-grîpsam, begreifend, fähig zu erfassen.
e-groten, 1. begrüssen. 2. die Grösse von etwas festsetzen, taxieren,
schätzen.
e-grotinge, Begrüssung.
e-guden, 1. mit Gütern versehen; be-gudet begütert. 2. abfinden.
e-guderen = beguden.
e-gudigen = beguden.
e-gudinge, Beschenkung.
e-gulden, mit einer Gülte versehen.
e-gunnen, vergönnen, bewilligen.
e-hach, n. Behagen, Gefallen, Belieben.
e-hachten = be-haften. behacht wesen, die Haftpflicht haben,
verantwortlich sein.
e-haften, in Haft nehmen.
e-haftunge, Verhaftung.
e-hagel, anmutig, gefällig.
e-hagen, mit einer Hecke (einem Hagen) umgeben.
e-hagen, gefallen; refl. woran Gefallen finden, sich freuen.
e-hagen (= be-hagende), gefallend, behaglich.
e-hâl, n. 1. Versteck. 2. Hinterhalt, List; Beeinträchtigung.
e-halden, s. beholden.
e-halen, 1. einholen, überholen. 2. übervorteilen, betrügen,
beeinträchtigen.
e-halinge, Übervorteilung, Betrügerei.
e-halnisse (= behaldenisse?) Haft.
e-haltaftich werden, etwas bekommen.
e-halven (zu halve, Seite), sw. v. von allen Seiten umgeben,
umringen.
e-halven, -halver, (zur Seite oder bei Seite gesetzt) ausgenommen,
ausser; noch verstärkt durch ûtgesecht.
e-hande, bei der Hand, gegenwärtig, nahe; geschickt, fein.
e-handelen, einhändigen.
e-handen, 1. in die Hände bekommen, habhaft werden. 2. in die
Hände liefern. 3. jem. belehnen.
e-hangen, hängen bleiben.
e-hanthaven, schützen, verteidigen.
e-hanthaveninge, Schutz.
e-hantreken, in die Hände geben, presentare.
e-hantstrecken, durch Handschlag geloben.
e-hantvesten, in Verhaft halten.
e-harden, s. be-herden.
e-haten, Hass hegen, hassen.
e-hebben, erreichen, bekommen, sich zu eigen machen.
e-hechten u. be-heften, einschliessen, fest machen.
e-hechtunge, -heftunge, Einschliessung.
e-heftich, heftig, gewaltig.
e-hegelicheit, Behaglichkeit, Lust, Wolgefallen.
e-hegelik, 1. günstig, geneigt, favorosus. 2. behaglich, angenehm,
lieb; adv. be-hegeliken, mit Behagen, gern.
e-hegen (= behagen), mit einer Hecke versehen, einhegen.
e-heilsamen, das Heil jemandes suchen und befördern; refl. sein
eignes Interesse im Auge haben.
e-heimen, Heimat geben, ins Haus aufnehmen.
e-helder, Inhaber, Besitzer.
e-helich = be-hegelich; be-helicheit = behegelicheit.
e-help, -hulp, m. 1. Hülfe. 2. Vorwand, (Rechts)ausrede.
e-helpen, 1. helfen. 2. mit Gen. zu etwas verhelfen, mit der Präp. van,
befreien von, abhelfen. 3. refl. sich Schutz, Hülfe verschaffen, sich
verteidigen, schützen; sik des schaden b., Ersatz des Schadens
suchen; seinen Lebensunterhalt suchen, seiner Nahrung nachgehen;
sich womit befassen; im rechtl. Sinn: sich eines Behelfs bedienen,
Exception machen. – be-helpen, -holpen, -hulpen sîn = helpen.
e-helperede = helpe-, hulperede.
e-helpich, behülflich.
e-helpinge = behelp.
e-helplik, behülflich.
e-helsen, umhalsen, umarmen.
e-heltenisse, 1. Erhaltung, Wohl, salus. 2. Vorbehalt, reservatio; auch
adv. mit Vorbehalt.
e-hemelen, heimisch, vertraut, freundlich machen.
e-hemel(i)cheit, Liebmachung, Gefallen.
e-hemmen, hindern, festhalten, impedire, retinere.
e-hende, 1. von Sachen: fein, geschickt, subtilis. 2. von Personen:
listig, schlau, gewandt. – adv. mit Geschick.
e-hendicheit, Klugheit, Gewandtheit, List.
e-hendich(-ec)liken, mit Geschick.
e-herbergen, in eine Herberge bringen; bequartieren, mit
Einquartierung belegen.
e-herden, -harden, 1. ergreifen, festnehmen. 2. behaupten, sichern.
3. bestärken, stützen. Intr. ausdauern, verharren.
e-herdinge, Ausdauer, Beständigkeit.
e-herdisch, mit einem Erbzins belastet, emphyteuticus.
e-heren, 1. als Herr regieren, beherschen. 2. als Herr beschützen.
e-hessen, behetzen, (Jagd ausüben).
e-hêt, -heit, Geheiss.
e-heten, heissen, verheissen, in Aussicht stellen, drohen.
e-hilliken, -hilken, 1. verheiraten. 2. sich verheiraten. 3. erheiraten.
e-hinderen, 1. verhinderen. 2. hemmen, festhalten.
e-hode, Hut, Achtsamkeit.
e-hodelik, -hotlik, behutsam.
e-hoden, -huden, 1. mit Vieh beweiden. 2. beschützen, bewahren, 3.
be-, verdecken.
e-hodenisse, -hotnisse, Beschützung.
e-hoder, Behüter; behodersche u. behodester, Beschützerin.
e-holde = beholt, Rettung, Seligkeit.
e-holdelik, -holtlik, vorbehältlich.
e-holden, -halden, 1. festhalten, in Besitz behalten; abs. (die Pferde
festhalten) still halten, 2. behaupten, behalten; aufbewahren,
gefangen halten. 3. erhalten, bekommen; überwinden, erobern. 4.
erhalten, beschützen; sik b., sich erhalten, sich nähren. – Im jurist.
Sinn: als Verpflichtung behalten, verpflichtet sein; vorbehalten,
reservieren (Part. abs. beholden mit Gen. [des], dat, mit Vorbehalt,
ausgenommen); durch Beweis (Eid oder Zeugen) behaupten,
beweisen.
e-holder, Bewahrer, Beschützer, Heiland.
e-holdinge, Erhaltung, Bewahrung.
e-holt, -halt, n. 1. Aufenthalt. 2. Besitz, detentio; Gewahrsam,
Gefängnis, 3. Behälter, Verschluss; Bereich, Bezirk. 4. Sicherheit,
Schutz, Rettung = salus.
e-holten, beholzen; refl. seine Holznutzung woraus ziehen.
e-holtenisse, 1. Versteck, latibulum. 2. Vorbehalt.
e-honen, verhöhnen.
e-hônslagen = behonen.
e-hôr, Gebühr; Gehörigkeit.
e-hôrde, Gebühr; (u. Gehör, Gehorsam?)
e-horen, 1. hören (anhören). 2. verhören, causam cognoscere. 3.
zugehören, zukommen, gebühren. 4. refl. sich ziemen, sich gehören.
e-horen, -huren, (zur Hure machen), vitiare feminam.
e-hôrhaftich, hörig.
e-horich, 1. zugehörig. 2. gehorsam, folgsam.
e-horinge, Hörigkeit.
e-hôrlik, 1. zugehörig, 2. gehörig, geziemend.
e-hôrliken, rite recteque.
e-hôrsam, Gehorsam.
e-hôrsam, gehorsam.
ehurt, s. bohurt.
e-houwen, behauen; techn. Ausdruck in der Weberei: vor dem
Färben mit einem Eisen ein Merkzeichen in das Tuch schlagen, es
zeichnen, Refl. sich durch Verhaue schützen.
e-hôf, n. und f. Behuf, Bedürfnis, Notdurft.
e-hôflicheit = behôfte.
e-hôfte, f. Bedürfnis.
e-hôfte, notwendig.
e-hôftich, bedürftig.
e-hoveden, bewahrheiten, bekräftigen.
e-hoven, bedürfen, nötig haben, gew. mit Gen.
e-hoverne, bedürftig, indigens.
e-hovich, bedürftig.
e-hovicheit, Dürftigkeit, egestas.
e-huchelen, belachen, verspotten.
e-huden, s. behoden.
e-hudester, s. behodester.
e-hulden, die Huldigung (Huldigungseid) leisten; Part. be-huldet, der
den Huldigungseid geleistet hat.
e-hulen, bejammern.
e-hulp, s. behelp.
e-hulpe u. be-hulpen, behülflich.
e-hulpelik, hülfreich, behülflich.
e-hulpich = behulpelik.
e-hulvern, laut bejammern.
e-huren, s. behoren.
e-husen, 1. trans. beherbergen. 2. intr. wohnen, sich niederlassen; zu
Hause sein, sich in Haushaft halten.
e-husinge, Behausung, Wohnung.
e-jach, n. Erwerb.
e-jagen, 1. jagend verfolgen, 2. erjagen, erwerben. de nôt b., das
was nötig ist (Lebensbedürfnisse) besorgen.
ejaringe, jahrelanger Besitz.
e-jârscharen, sw. v. eine Jahresfrist lang benützen.
e-jaworden, sw. v. sein Jawort zu etwas geben, genehmigen.
e-jegenen = begegenen.
e-jenen, begähnen, den Mund gegen etwas aufsperren.
ei-beren, Bick-, Heidelbeeren.
eide (bêde), beide; adv. mit nachfolgendem unde, sowol – als auch;
beide erstreckt sich auch auf drei, ja vier Glieder.
eidelik (= weidelik?), spectabilis, edel, vornehm.
eiden, warten; mit Gen. oder mit na und mit.
eiderwant (beidelwant), Tuch von Lein und Wolle.
eidicheit, Warten, Verzug.
eidinge, (bange) Erwartung.
eie, bie, s. bene.
eien, beigen, sw. v. bähen.
eier, Eber, s. bêr.
eiern (beigern), sw. v. die eine Seite der Glocke mit dem Klöppel
anschlagen (meist in frequentativer Bewegung), bacillare.
eigel-, beielwant = beiderwant.
e-insegelen, besiegelen.
e-isen, be-eisen, vom Eise reinigen.
eiten (bêten), sw. v. mit Falken jagen.
e-kallen, 1. besprechen, verabreden. 2. bereden, überreden.
e-kallinge, Besprechung, Verabredung.
e-kans (= bi kanse, engl. by chance), vielleicht, ungefähr.
ekant, 1. act. kennend, wissend. b. wesen (stân), mit Gen.
eingestehen, bekennen. 2. pass, bekannt. – Im jurist. Sinn: sich
(durch eine feste Abgabe, Recognition) als pflichtig, abhängig
bekennend.
e-kantenisse, -kentenisse, 1. Erkentnis. 2. Kentnis. 3. Bekentnis,
Beichte. 4. Zusage, Jawort (eines Mädchens). 5. Recognition (feste
Abgabe) als Zeichen der Abhängigkeit; dann überh. Gabe freundlicher
Abhängigkeit und Dankbarkeit, Erkentlichkeit. 6. Zeugnis.
e-kanntnisbrêf, Urkunde, in der man sich zu einer Schuld etc.
bekennt.
e-kantheit, Er-, Bekentnis.
e-kappet, mit einem Klostergewande (kappe) versehen.
e-kargen, 1. kargend zusammenbringen. 2. beknausern.
e-karmen, bejammern.
e-karminge, Bejammerung.
eke, f. und m. Bach.
e-keden, beketten, mit Ketten versehen.
ekeler, fructus oliue vel laurium vel omnium siluestrium arborum. Ndl.
baeckelaer aus bacca lauri.
e-kennen, 1. erkennen, durch Sinn oder Geist wahrnehmen. 2.
kennen lernen, erfahren. 3. kennen. 4. erkennen (in biblischem Sinn),
concumbere. 5. bekennen, eingestehen. 6. anerkennen (einen Herren,
die Rechte, den Besitz, eine Schuld etc.)
e-kenner, Erkenner, Kenner etc.
e-kennester = bekennich.
e-kennich, 1. geständig. 2. zum Zugeständnis, zur Anerkennung
bereit oder verpflichtet.
e-kenninge, 1. Erkentnis, Kentnis. 2. Bekentnis. 3. = bekantenisse.
e-kentlik, 1. eingeständig. 2. erkennbar; bekannt.
e-kentliken, bekanterweise; öffentlich.
e-kentnisse, s. bekantnisse.
eker, m. Becher; als bestimtes Mass für flüssige und trockene Dinge.
e-keren, 1. anlegen, (Geld) anwenden. 2. bekehren, im theol. Sinn;
refl. im medic. Sinn: genesen, besser werden.
ékerer, Bechermacher.
eker-gôt, Begiessung mit dem Inhalt des Bechers.
eker-maker, Bechermacher.
eke-stouwe, Bachstauung.
e-kiken, 1. intr. hineinsehen. 2. trans. begucken, beschauen.
e-kilen, mit Keilen befestigen.
e-kinden, 1. bekindet sîn, Kinder haben. 2. sik b. mit, Kinder zeugen.
e-kiven, 1. bestreiten, bekämpfen. 2. wofür streiten, erkämpfen. 2.
(bekeifen), ausschelten, increpare.
e-klach, Klage.
e-klagen, 1. beklagen. 2. anklagen. 3. Klage über etwas erheben vor
jem. – Auch refl. in diesem Sinn.
e-klappen, -klaffen, anschuldigen, verklagen; anschwärzen.
e-klapper, Ankläger, Verleumder.
e-kleden, 1. bekleiden. 2. im gerichtl. Sinn: die Bank, den
Gerichtsstuhl bekleiden, als Richter fungieren; überh. eine Stelle, ein
Amt bekleiden. Bildl.: bemänteln.
e-kleimen, beschmieren, bestreichen.
e-klemmen, umspannen; einschliessen.
e-klicken, mit Schmutz besprützen; bildl.: verleumden.
e-klickeren = beklicken.
e-klivelik, ansteckend.
e-kliven, kleben; ankleben, anhaften; von Bäumen: Wurzel schlagen;
vom Feuer: haften bleiben; von Krankheiten: ansteckend sein.
e-kloken, überlisten, betrügen.
e-kluven, beklauben.
e-knicken, durch geknickte, gefällte Bäume einschliessen.
e-knien, das Knie, d. h. den Grad der Verwandtschaft rechnen und
angeben.
e-knipen, kneifen, peinigen.
e-kochelen, begaukeln.
e-kolden, kalt werden.
e-kolen, kühl machen, kühlen.
e-komen, 1. intr. bequem sein, passen, (wol oder übel) anschlagen,
gereichen; gefallen; werden (wie engl. become); begegnen. 2. trans.
bekommen (in die Gewalt), erreichen, mit Acc. u. Gen. Refl. zu einer
Sache (Person) kommen; sich erholen (schadlos halten).
e-komte, das Bequem-sein, Gefallen.
e-kopen, 1. einkaufen. 2. bezahlen, büssen. 3. im Kauf betrügen,
übervorteilen.
e-koren (= be-koderen?) 1. versuchen, in Versuchung führen
(beschwatzen). 2. untersuchen, prüfen. 3. ansuchen, bitten (bereden).
e-koringe, 1. Versuchung. 2. Ansuchung, Bitte.
e-kosten, die Kosten tragen; bes. für den Unterhalt; refl. sich in
Kosten setzen, Aufwand machen.
e-kostigen = bekosten.
e-kostinge, das Tragen der Kosten, (Geld)aufwand.
e-koveren, erholen, gewinnen, bekommen = erkoveren.
e-kreften, -krechten, -krachten, 1. mit Gewalt nehmen,
unterwerfen. 2. (mit Gewalt) schützen.
e-kreftigen, -krechtigen = bekreften.
e-krenken, krank d. h. schwach machen, schwächen.
e-krigen, bekommen.
e-krimpen = behouwen? (im Wollengeschäft).
e-kroden, -kruden, hindern (durch Ansprache, Klage etc.)
e-kronen, Klage führen, conqueri.
e-krummen, umfassen, umarmen.
e-krupen, bekriechen, zu jem. kriechen; schwängern.
e-kuderen (-koderen), beschwatzen, durch Schwatzen bethören.
e-kumberen, -kummeren, 1. besetzen (einen Ort), occupare. 2.
pfänden, mit Arrest, Beschlag belegen, anhalten, festnehmen. 3.
bekumbert sîn, in Sorge, in Not sein; womit beschäftigt sein. 4. refl.
Gemeinschaft, Verkehr haben mit, auch im sexuellen Sinn.
e-kumberinge, 1. Besetzung; Belästigung. 2. Beschäftigung.
e-kumbernisse = bekummeringe.
e-kumpen, refl. Compagnie machen mit jem.
e-kurren (be-kuren), bemurren, (heimlich) tadeln.
e-lach, s. be-lech u. belegenheit.
e-lachen, auslachen, verlachen.
e-laden, 1. belasten. 2. einladen.
e-landen, anlanden.
e-landnisse, Abgabe für die Bergung von Strandgut.
e-langen, 1. die Hand wornach ausstrecken, an sich bringen;
verlangen; in jurist. Sinn: vor Gericht belangen. 2. refl. sich treffen,
ereignen.
elangen = be-langende, anlangend, betreffend.
e-langen, adv. bei weitem; präp. längs, entlang.
e-lank, Belang, Bedeutung.
e-last, Belästigung; zur Last-legung, Beschimpfung.
e-lasten, beauftragen.
e-lastern, lästern, schmähen.
e-lastich, lästig.
e-lât, n. Stelle, Raum, wo man etwas (be)lässt.
e-laten, 1. belassen; ver-, zurücklassen. 2. hinterlassen,
testamentarisch vermachen.
e-latingbôk, Vermächtnisbuch.
e-latinge, Vermächtnis.
elde (belt), bilde (bilt), n. 1. Bild (Marienbild am Almosenbret, Art
Klingelbeutel). 2. Vorbild, Muster.
elderen = balderen.
e-lach, belech, n. Belagerung; = belegelicheit.
e-lecherlik, belachenswert.
e-lechlik = be-legelik.
e-lêden (-leiden), 1. Leid tragen, betrauern, beklagen. 2. leid
machen, verleiden? s. auch beleiden.
e-legelicheit, Belegenheit; Plur. Zubehörungen, Pertinenzien.
e-legelik, -lechlik, gelegen; passend.
e-legenheit, Beschaffenheit.
e-legenicheit = belegelicheit.
e-legen, gelegen; passend, bequem.
e-lêgen, belügen, verleumden.
e-legeringe u. beleger, Belagerung.
e-legern, refl. sich lagern.
e-legertûch, Belagerungszeug.
e-leggen (-legen), 1. belegen, besetzen. 2. beschlafen. 3.
herumlegen. 4. umzingeln, belagern. 5. niederlegen, deponieren
(Geld), auf Zinsen legen. 6. ersetzen, entschädigen, bezahlen. 7.
überlegen. 8. darlegen, beweisen; ein ordêl b., ein Urteil bestätigen.
9. = bileggen, zur Seite setzen, entsetzen; abthun. Refl. sich
niederlegen; bi sinem ede, eidlich erhärten.
e-legginge, 1. Belagerung. 2. Belegung, das Tuch, womit die Tische
in den Ratszimmern belegt wurden.
e-leiden (-lêden), 1. begleiten. 2. sicheres Geleit geben. 3. verleiten,
verführen. 4. leiten, einrichten, regeln.
e-leiden, beweisen, überführen (vgl. belien).
e-leiden (zu leiden, blitzen?) mit Blitzen treffen?
e-leider, Begleiter, Führer.
e-leidigen, 1. betrauern, beklagen. 2. Leid zufügen.
e-leidunge, 1. Führung; bildlich: Methode. 2. Vor-, Verführung?
e-leitsagen, führen, geleiten.
e-lemen, lähmen, lahm machen.
e-lemmeren, hindern, hemmen, occupare, impedire, molestare.
e-lemmeringe, Hindernis, Hemmung.
e-lemmertheide, Hemmung, Hindernis; Beschäftigung, occupatio.
e-lenden, 1. aufhören, enden. 2. = belanden. Refl. sich am Ufer
anlanden, von der Alluvion.
e-leren, belehren.
e-lerer, Lehrer.
e-lesen, 1. auslesen; bes. ein techn. Ausdruck der Münzer: die
schwereren Münzen auslesen. 2. einen Altar: die Messe an einem
bestimten Altar lesen.
e-leser, des Altars: der die Verpflichtung hat, die Messe an einem
bestimten Altar zu lesen.
e-lesunge, das Messelesen an einem Altare.
e-let, 1. Hindernis, sunder b., ungesäumt; Beschäftigung, occupatio.
2. Ende. 3. die äusserste Verteidigungslinie.
e-letsel, n. Hindernis.
e-letten, hindern, aufhalten; mit Arrest belegen.
e-lettinge, Hindernis.
e-lêfdicheit, Höflichkeit (das Sich-lieb-machen).
e-leven, 1. intr. leben bleiben. 2. trans. erleben.
e-lêven, 1. lieb haben. 2. belieben, gutheissen, genehmigen. 3. intr.
lieb sein, gefallen. 4. refl. sich lieb machen.
e-lêver, Liebhaber.
e-lêvinge, das Liebhaben, Gefallen.
elgen, sw. v. von dem Balge, der Schale etc. reinigen.
e-lichtinge, ein Name für das Fest der Reinigung Mariä (Lichtmesse).
e-lien, bekennen, aussagen (vgl. beleiden); mit Acc. u. Gen. Refl. sik
b. bi sinem ede, eidlich erhärten (= sik beleggen).
e-lien, belehnen; s. be-ligen.
e-lîfdingen, sw. v. jem. ein Leibgedinge geben.
e-lîftuchten, sw. v. jem. Leibzucht, Leibgedinge geben.
e-ligen, -lien, belehnen; verleihen, zu Lehn geben.
e-liggen, 1. intr. liegen; liegen bleiben. 2. trans. belagern (=
beleggen).
e-ligger, Ballier (Name eines obrigkeitlichen Amtes).
e-ligginge, Belagerung (= belegginge).
e-liginge, Verleihung, Belehnung.
e-likenen, -liken, mit Fug u. Recht zukommen; begleichen.
e-limpe, Glimpf habend, angenehm, gefallend.
e-linigen, 1. mit Linien beziehen. 2. die Verwandtschaftslinie
nachweisen.
e-listigen, überlisten.
elken = bolken.
elkere, eine Art grobes Leinenzeug.
elle, Schelle.
ellen, sw. v. (die Schelle rühren), laut verkündigen.
e-locken, verlocken.
e-lofte, Versprechen.
e-loften, versprechen.
e-loftenisse, -lofnisse, Versprechen.
e-loien (-logen), Tücher, die bei der Wardierung gut befunden, mit
einem bleiernen Stempel (loie) versehen.
e-lonen, lohnen; Lohn, Sold geben.
e-loninge, Löhnung.
e-lônlik, Lohn einbringend.
e-lôp, 1. Lauf. 2. Umfang. 3. Belauf, Höhe.
e-lopen, 1. belaufen, über etwas laufen; überströmen. 2.
überraschen, ertappen, betreffen. 3. früher als ein anderer einnehmen
und besetzen.
e-lôf, Versprechen; Glaube.
e-loven, 1. geloben, versprechen. 2. verloben. 3. glauben. 4.
vertrauen, anvertrauen, creditieren.
elter, Lederarbeiter (= baltearius?)
e-luchten, beleuchten, eig. u. bildl.
e-luden, 1. verlauten, b. laten, laut werden lassen. 2. tr. über jem.
etwas laut werden lassen, ihn verleumden.
e-luken, zuziehen, schliessen.
e-lumen, beleumunden.
e-lumet, Leumund, (üble) Nachrede.
e-lustelik, lieblich, anmutig.
e-lusten, 1. belustigen, ergötzen. 2. refl. seine Freude an etwas
haben. Part. belustet, voll Lust u. Anmut.
e-lustinge, Behagen, Lust.
e-lusteren, behorchen, belauschen.
e-luten, beläuten; = beluden.
e-lutteren, declarieren; refl. sik b. mit, sich auseinandersetzen mit.
e-maget, verwandt.
e-maken, beschmutzen; vgl. be-dôn.
e-malven, einen Heereszug machen gegen jem.
e-manen, einfordern, einmahnen, reclamieren.
e-maninge, Einforderung.
e-mannen, 1. übermannen, überwältigen. 2. mit Mannschaft
besetzen. 3. die manschap, den Lehnseid verlangen.
e-mantelen, bemänteln, verdecken.
e-mechtigen, ermächtigen.
e-meieren (-meigeren), 1. mit Meiern besetzen; in meierstad ûtdôn.
2. als Meier besitzen.
e-meldinge, Meldung, Aussage.
emesch, böhmisch, b. esel, graues Tuch aus Böhmen; ein böhmischer
Groschen.
e-migen, bepissen.
emoden = be-moien.
e-moien, -moigen, -mogen, jem. Mühe, Arbeit schaffen, quälen.
e-morgengaven, -morgaven, mit einer Morgengabe ausstatten.
e-morwen, mürbe machen.
e-muderen, zu muder, modder, Moder werden.
e-muren, 1. mit einer Mauer versehen, umgeben. 2. einmauern.
ên, bein, n. 1. Knochen. 2. das ganze Geheglied, to bene binden, ans
Bein binden d. i. für unbedeutend halten; to bene komen, auf die
Beine, emporkommen.
e-nachten, über Nacht bleiben, b. laten, eine Nacht über etwas
hingehen lassen.
e-naken, 1. nahe bringen, einhändigen. 2. refl. sich nähern, mit Gen.
sich bemächtigen.
e-nalen, 1. nahe bringen, mitteilen; einhändigen. 2. intr. nahe
kommen, sich nähern. 3. refl. sich nähern; mit Gen.: sich
bemächtigen, bekommen; to harnsche sik b., sich wappnen mit H.
e-namen, s. binamen.
endel, n. Binde, schmales Band, Litze, Schnur, fascia.
endelt, mit bendel versehen, belitzt, fasciatus.
endich, was sich am Bande führen lässt, zahm.
endik? bendiken Gläser, d. h.?
ene, beine, f. Biene.
e-nêden, wagen, sich erkühnen.
e-nedden, -neden, -nedes, adv. u. präp. unten, unter, unterhalb;
eig. u. bildl.
e-negen, -neien, benähen, einnähen.
eneken, n. Bienchen und Beinchen.
e-nemelik, (mit Namen genannt), bestimt.
e-nemeliken, namentlich; besonders.
e-nemen, 1. mit Acc. d. P. berauben, plündern. 2. mit Dat. d. P. u.
Acc. d. S. wegnehmen, entziehen, hindern. 3. mit Dat. d. P. u. Gen. d.
S. (oder van) entlasten, befreien. 4. refl. sich wegnehmen, sich
entfernen.
e-neminge, Wegnahme; Entlastung.
enen, beinern, von Knochen.
e-nenen, -neinen, sw. v. ableugnen.
ene-net? ..netz?
e-nentlich, mit Namen genannt; nominatim.
e-nesten, (ein Nest machen), sich einnisten.
e-nêten, geniessen.
e-neven, -neffens, adv. u. präp. neben.
ên-harns, Beinharnisch.
ên-hûs, Beinhaus, carnarium.
e-niden, beneiden, misgönnen.
enît, ein mit Schnüren etc. besetzter Hut, frz. bonnet.
enk = bank.
enk-houwer, der die Erde in rohen Klumpen auf die Bank schlägt?
(beim Ziegel-, Steinbrennen).
ennich, im Banne befindlich.
e-nôch, -noge, n. Genüge.
e-noden, 1. nötig sein, und nötig haben, bedürfen. 2. nötigen,
zwingen.
e-nodicheide, Bedrängnis.
e-nodigen, nötigen, bedrängen.
e-nodiger, Bedränger.
e-nodinge, Nötigung, Zwang.
e-nogen, 1. genügen (der Schuld), bezahlen. 2. refl. sich begnügen.
e-nogent, Genüge.
e-noginge, Genüge.
e-nomachtich, Namen (guten Ruf) habend.
e-nome (= binamen), fürwahr. (?)
e-nomelik, benannt.
e-nomeliken, 1. namentlich. 2. nemlich.
e-nomen, 1. mit Namen nennen. 2. namentlich, d. i. bestimt u. genau
angeben. 3. bestimmen, festsetzen.
enomet, namhaft, berühmt.
e- (bi)norden, nördlich; ebenso beosten, besuden, bewesten etc.
e-nouwen, -nauwen, einengen, einschränken, in Not bringen,
ängstigen.
e-nouwinge, Beengung; Angst.
ên-rump, Bienenkorb.
ên-setich, am Bein, d. i. Knochen festsitzend.
ên-span, Beinspange.
ên- (bene-, benen-, bener)stok, Bienenkorb, Beute, alveare.
ên-suge, Pflanze. apiaticum; stachys sylvatica.
ent, bente = wente, bis.
ênte, n. die Gebeine.
ent-hake, Bandhake (Werkzeug der Böttcher, um die Reife aufs Fass
zu zwängen).
ent-holt, Bandholz, wie es die bentsnidere gebrauchen.
ent-kanne, eine mit Bändern belegte Kanne.
ent-snider, Bandschneider; sie verfertigten das Gebinde zu den
Tonnen.
e-nutteln, (zu notula) in Schrift fassen, beurkunden.
ên-wapen, Beinharnisch.
ênwelle, eine Pflanze, anagallis. symphytum off.
e-okenamen, Beinamen, Schimpfnamen geben.
e-olden, alt werden.
e-orden, 1. im Münzwesen: die Stücke justieren. 2. in der
Kirchensprache: regulieren (nach einer Regel ordnen).
e-ordelen, über jem. ein Urtel sprechen.
e-orlêven, erlauben, gestatten.
e-orsaken, verursachen.
e-pachten, mit Pacht beschweren.
e-palen, mit Pfählen versehen; refl. sich verbarrikadieren,
verschanzen.
e-pinen, durch Arbeit erwerben.
e-planken (-blanken), mit Planken umgeben, vallare.
e-planten, bepflanzen.
e-plichtigen, zur Pflicht machen.
e-plucken, pflücken, rupfen.
e-poten, -paten, mit Pflänzlingen besetzen oder bepflanzen.
e-potunge, Bepflanzung.
e-quellern, refl. sich mit queller bedecken.
e-queme, -quame, 1. passend, geschickt, tauglich. 2. leutselig,
gefällig, fügsam, folgsam. – conveniens.
e-queken, lebendig machen.
e-quemelik, passend, schicklich, gefügig.
e-quemen, refl. sich passen, sich schicken.
e-quemicheit, -heit, 1. passende Gelegenheit. 2. Bequemlichkeit,
Behagen. 3. Freundlichkeit.
e-quinen, arten, gedeihen, Wurzel schlagen, complexionari, naturari,
prosperari.
êr (beir), n. Bier.
êr (beier), m. Eber, Zuchteber.
e-raden, 1. begaben, versehen, versorgen. 2. ausstatten, verheiraten
(Töchter). 3. refl. sich beraten, überlegen. – Part. beraden =
beradenes modes (Ggs. unabsichtlich).
e-raden = bereden, bereden, Anklage erheben (fries.)
e-radinge, Ausstattung.
e-raken, verscharren, bedecken.
e-raken, dergestalt einrichten (treffen), dass der Zweck damit erreicht
werde. (Vgl. raken).
e-râm, m. Festsetzung, Übereinkunft.
e-ramen, festsetzen, bestimmen (anberaumen), mit Gen. u. Acc.
e-raminge, Festsetzung, Bestimmung.
e-rasten, ruhen; b. laten, im Besitz nicht stören.
e-rât, n. 1. Überlegung, Beratschlagung. 2. Beratungsfrist, Bedenkzeit.
3. Ausberat, Ausstattung, Verheiratung.
êr-bank, Bierbank (Wirtshaus).
êr-bant, Bierband (die Belegung der Tonnen oben und unten mit
Reifen, so dass die Mitte frei bleibt, während beim herinkbant an vier
Stellen drei Reifen um die Tonne gelegt werden.)
erbolle, Knospe, Pflanzenauge.
erbore, Bahre zum Tragen der Biertonnen?
erch, m. Berg; over b.,, über die Alpen.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like