100% found this document useful (2 votes)
6 views

7219An Introduction to Statistics with Python With Applications in the Life Sciences 2nd 2nd Edition Thomas Haslwanter pdf download

The document is an introduction to the second edition of 'An Introduction to Statistics with Python' by Thomas Haslwanter, focusing on statistical analysis in the life sciences. It highlights the book's aim to provide practical help and tools for statistical problems using Python, which is free and accessible. The second edition includes updates on Python's popularity, new packages, and expanded content on data visualization and statistical methods.

Uploaded by

rrushsirex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
6 views

7219An Introduction to Statistics with Python With Applications in the Life Sciences 2nd 2nd Edition Thomas Haslwanter pdf download

The document is an introduction to the second edition of 'An Introduction to Statistics with Python' by Thomas Haslwanter, focusing on statistical analysis in the life sciences. It highlights the book's aim to provide practical help and tools for statistical problems using Python, which is free and accessible. The second edition includes updates on Python's popularity, new packages, and expanded content on data visualization and statistical methods.

Uploaded by

rrushsirex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

An Introduction to Statistics with Python With

Applications in the Life Sciences 2nd 2nd


Edition Thomas Haslwanter install download

https://ebookmeta.com/product/an-introduction-to-statistics-with-
python-with-applications-in-the-life-sciences-2nd-2nd-edition-
thomas-haslwanter/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

An Introduction to Statistical Learning: with


Applications in Python Gareth James

https://ebookmeta.com/product/an-introduction-to-statistical-
learning-with-applications-in-python-gareth-james/

Introduction to Statistics and Data Analysis: With


Exercises, Solutions and Applications in R, 2nd Edition
Christian Heumann

https://ebookmeta.com/product/introduction-to-statistics-and-
data-analysis-with-exercises-solutions-and-applications-in-r-2nd-
edition-christian-heumann/

The New Statistics with R: An Introduction for


Biologists 2nd Edition Andy Hector

https://ebookmeta.com/product/the-new-statistics-with-r-an-
introduction-for-biologists-2nd-edition-andy-hector/

The Japanese Economy 4th Edition David Flath

https://ebookmeta.com/product/the-japanese-economy-4th-edition-
david-flath/
Fashion Merchandising Principles and Practice 2nd
Edition James Clark

https://ebookmeta.com/product/fashion-merchandising-principles-
and-practice-2nd-edition-james-clark/

My First Nursery Rhymes Kim Mitzo Thompson Karen Mitzo


Hilderbrand

https://ebookmeta.com/product/my-first-nursery-rhymes-kim-mitzo-
thompson-karen-mitzo-hilderbrand/

Building Sustainable Financing Structures for


Population Health Insights from Non Health Sectors
Proceedings of a Workshop 1st Edition And Medicine
Engineering National Academies Of Sciences
https://ebookmeta.com/product/building-sustainable-financing-
structures-for-population-health-insights-from-non-health-
sectors-proceedings-of-a-workshop-1st-edition-and-medicine-
engineering-national-academies-of-sciences/

Traffic and Pavement Engineering (Solved Practical


Problems in Transportation Engineering, 1) 2-Volume
Set. 1st Edition Ghazi G. Al-Khateeb

https://ebookmeta.com/product/traffic-and-pavement-engineering-
solved-practical-problems-in-transportation-
engineering-1-2-volume-set-1st-edition-ghazi-g-al-khateeb/

The Substance of Representation Congress American


Political Development and Lawmaking John S. Lapinski

https://ebookmeta.com/product/the-substance-of-representation-
congress-american-political-development-and-lawmaking-john-s-
lapinski/
Source Grid Interaction of Wind Power Integration
Systems 1st Edition Da Xie Xitian Wang Yanchi Zhang
Chenghong Gu

https://ebookmeta.com/product/source-grid-interaction-of-wind-
power-integration-systems-1st-edition-da-xie-xitian-wang-yanchi-
zhang-chenghong-gu-2/
Statistics and Computing

Thomas Haslwanter

An Introduction
to Statistics
with Python
With Applications in the Life Sciences
Second Edition
Statistics and Computing

Series Editor
Wolfgang Karl Härdle, Humboldt-Universität zu Berlin, Berlin, Germany
Statistics and Computing (SC) includes monographs and advanced texts on statistical
computing and statistical packages.

More information about this series at https://link.springer.com/bookseries/3022


Thomas Haslwanter

An Introduction to Statistics
with Python
With Applications in the Life Sciences
Second Edition
Thomas Haslwanter
School of Medical Engineering and Applied
Social Sciences
University of Applied Sciences Upper Austria
Linz, Austria

ISSN 1431-8784 ISSN 2197-1706 (electronic)


Statistics and Computing
ISBN 978-3-030-97370-4 ISBN 978-3-030-97371-1 (eBook)
https://doi.org/10.1007/978-3-030-97371-1

1st edition: © Springer International Publishing Switzerland 2016


2nd edition: © Springer Nature Switzerland AG 2022
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To my two-, three-, and four-legged
household companions: Jean, Felix, and his
sister Jessica: Thank you so much for all the
support you have provided over the years!
Preface

Preface to the First Edition

In the data analysis for my own research work, I was often slowed down by two
things: (1) I did not know enough statistics, and (2) the books available would provide
a theoretical background, but no real practical help. The book you are holding in your
hands (or on your tablet or laptop) is intended to be the book that will solve this very
problem. It is designed to provide enough basic understanding so that you know what
you are doing, and it should equip you with the tools you need. I believe that the
Python solutions provided in this book for the most basic statistical problems address
at least 90% of the problems that most physicists, biologists, and medical doctors
encounter in their work. So if you are the typical graduate student working on your
degree, or a medical researcher analyzing your latest experiments, chances are that
you will find the tools you require here—explanation and source-code included.
This is the reason I have focused on statistical basics and hypothesis tests in
this book, and refer only briefly to other statistical approaches. I am well aware
that most of the tests presented in this book can also be carried out using statistical
modeling. But in many cases, this is not the methodology used in many life science
journals. Advanced statistical analysis goes beyond the scope of this book, and—to
be frank—exceeds my own knowledge of statistics.
My motivation for providing the solutions in Python is based on two considera-
tions. One is that I would like them to be available to everyone. While commercial
solutions like Matlab, SPSS, Minitab etc. offer powerful tools, most can only use
them legally in an academic setting. In contrast, Python is completely free (as in free
beer is often heard in the Python community). The second reason is that Python is the
most beautiful coding language that I have yet encountered; and around 2010 Python
and its documentation matured to the point where one can use it without being an
serious coder. Together, this book, Python, and the tools that the Python ecosystem
offers today provide a beautiful, free package that covers all the statistics that most
researchers will need in their lifetime.

vii
viii Preface

Preface to the Second Edition

Since the publication of the first edition, Python has continuously gained popularity
and become firmly established as one of the foremost programming languages for
statistical data analysis. All the core packages have matured. And thanks to the
stunning development of Jupyter as an interactive programming environment, Python
has become even more accessible for people with little programming background.
To reflect these developments, and to incorporate the suggestions I have received for
improving the presentation of the material, Springer has given me the opportunity to
bring out a new edition of Introduction to Statistics with Python.
Compared to the first edition, the following changes have been made:
• The package pandas and its DataFrames have become an integral part of
scientific Python, as has the Jupyter framework for interactive data environ-
ments. Correspondingly, a bigger amount of space has been dedicated to their
introduction.
• A new package, pingouin, is promising a simplified and more powerful inter-
face for many common statistics function. This package is introduced, and many
application examples have been added.
• The visualization of data has been expanded, including the preparation of
publication-ready graphics.
• The design of experiments and power analyses are discussed in more detail.
• A new section has been added on the confidence intervals of frequently used
statistical parameters.
• A new chapter has been added on finding patterns in data, including an introduction
to the correlation coefficient, cross- and autocorrelation. For an application of
these concepts, a short introduction is given to time series analysis.
As for the first edition, all examples and solutions from this book are again avail-
able online. This includes code samples and example programs, Jupyter Notebooks
with additional or extended information, as well as the data and Python code used to
generate most of the figures. They can be downloaded from https://github.com/tho
mas-haslwanter/statsintro-python-2e.
I hope this book will help you with the statistical analysis of your data, and
convey some of the often really simple ideas behind the sometimes awkwardly named
statistical analysis procedures.

For Whom This Book Is

This book assumes that


• you have some basic programming experience: If you have done no programming
previously, you may want to start out with Python using some of the great links
provided in the text. Starting programming and starting statistics may be a bit
Preface ix

much all at once. However, solutions provided to the exercises at the end of most
chapters should help you to get up to speed with Python.
• you are not a statistics expert: If you have advanced statistics experience, the
online help in Python and the Python packages may be sufficient to allow you to
do most of your data analysis right away. This book may still help you to get started
with Python. However, the book concentrates on the basic ideas of statistics and
on hypothesis tests, and only the last part introduces linear regression modeling
and Bayesian statistics.
This book is designed to give you all (or at least most of) the tools that you
will need for statistical data analysis. I attempt to provide the background you need
to understand what you are doing. I do not prove any theorems, and do not apply
mathematics unless necessary. For all tests, a working Python program is provided.
In principle, you just have to define your problem, select the corresponding program,
and adapt it to your needs. This should allow you to get going quickly, even if you
have little Python experience. This is also the reason why I have not provided the
software as one single Python package; I expect that you will have to tailor each
program to your specific setup (data format, etc.).
This book is organized into three parts
Part I gives an introduction to Python: how to set it up, simple programs to get
started, and tips on how to avoid some common mistakes. It also shows how to
read data from different sources into Python, and how to visualize statistical data.
Part II provides an introduction to statistical analysis; on how to design a study,
power analysis, and how best to analyze data; probability distributions; and an
overview of the most important hypothesis tests. Even though modern statistics
is firmly based in statistical modeling, hypothesis tests still seem to dominate the
life sciences. For each test, a Python program is provided that shows how the test
can be implemented.
Part III provides an introduction to correlation and regression analysis, time
series analysis, and statistical modeling, and a look at advanced statistical analysis
procedures. I have also included tests on discrete data in this section, such as
logistic regression, as they utilize “generalized linear models” which I regard
as advanced. This part ends with a presentation of the basic ideas of Bayesian
statistics.
To achieve all those goals as quickly as possible, the Appendix A of the book
provides hints on how to efficiently develop correct and working code. This should
get you to the point where you can get things done quickly.
x Preface

Acknowledgments

Python is built on the contributions from the user community, and some of the sections
in this book are based on some of the excellent information available on the web.
(Permission has been granted by the authors to reprint their contributions here.)
I especially want to thank the following people:
• Christiane Takacs helped me enormously by polishing the introductory statistics
sections.
• Connor Johnson wrote a very nice blog explaining the results of the statsmodels
OLS command, which provided the basis for the section on Statistical Models.
• Cam Davidson Pilon wrote the excellent open-source e-book Probabilistic-
Programming-and-Bayesian-Methods-for-Hackers. From there, I took the
example of the Challenger disaster to demonstrate Bayesian statistics.
• Fabian Pedregosa’s blog on ordinal logistic regression allowed me to include this
topic, which otherwise would be admittedly beyond my own skills.
I also want to thank Springer Publishing for the chance to bring out the second
edition of this book, and to base the three introductory chapters (Python, Data Import,
and Data Display) to a significant part on the corresponding chapters of my book
Hands-on Signal Analysis with Python.
If you have a suggestion or correction, please send an email to my work address
[email protected]. If I make a change based on your feedback, I will add
you to the list of contributors unless advised otherwise. If you include at least part
of the sentence the error appears in, that makes it easy for me to search. Page and
section numbers are fine, too, but not as easy to work with. Thanks!

Linz, Austria Thomas Haslwanter


August 2022
Contents

Part I Python and Statistics


1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Why Statistics? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Accompanying Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Elements of Scientific Python Programming . . . . . . . . . . . . . . . . . . 15
2.3 Interactive Programming—IPython/Jupyter . . . . . . . . . . . . . . . . . . 28
2.4 Statistics Packages for Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.5 Programming Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3 Data Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.1 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.2 Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.3 Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.4 Binary Data: NPZ Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.5 Other Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4 Data Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.1 Introductory Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.2 Plotting in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.3 Saving a Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.4 Preparing Figures for Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.5 Display of Statistical Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

xi
xii Contents

Part II Distributions and Hypothesis Tests


5 Basic Statistical Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.1 Populations and Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3 Probability Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.4 Degrees of Freedom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.5 Study Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6 Distributions of One Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.1 Characterizing a Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.2 Discrete Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.3 Normal Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.4 Continuous Distributions Derived from the Normal
Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.5 Other Continuous Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.6 Confidence Intervals of Selected Statistical Parameters . . . . . . . . 135
6.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
7 Hypothesis Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.1 Typical Analysis Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.2 Hypothesis Tests and Power Analyses . . . . . . . . . . . . . . . . . . . . . . . 144
7.3 Sensitivity and Specificity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
7.4 Receiver-Operating-Characteristic (ROC) Curve . . . . . . . . . . . . . . 155
7.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
8 Tests of Means of Numerical Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.1 Distribution of a Sample Mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.2 Comparison of Two Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
8.3 Comparison of Multiple Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
8.4 Summary: Selecting the Right Test for Comparing Groups . . . . . 176
8.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
9 Tests on Categorical Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
9.1 Proportions and Confidence Intervals . . . . . . . . . . . . . . . . . . . . . . . . 182
9.2 Tests Using Frequency Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
9.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
10 Analysis of Survival Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
10.1 Survival Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
10.2 Survival Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
10.3 Comparing Survival Curves in Two Groups . . . . . . . . . . . . . . . . . . 202

Part III Statistical Modeling


11 Finding Patterns in Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.1 Cross Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.2 Correlation Coefficient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
11.3 Coefficient of Determination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Contents xiii

11.4 Scatterplot Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214


11.5 Correlation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.6 Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
11.7 Time-Series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
12 Linear Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
12.1 Simple Fits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
12.2 Design Matrix and Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
12.3 Linear Regression Analysis with Python . . . . . . . . . . . . . . . . . . . . . 237
12.4 Model Results of Linear Regression Models . . . . . . . . . . . . . . . . . . 241
12.5 Assumptions and Interpretations of Linear Regression . . . . . . . . . 257
12.6 Bootstrapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
12.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
13 Generalized Linear Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
13.1 Comparing and Modeling Ranked Data . . . . . . . . . . . . . . . . . . . . . . 265
13.2 Elements of GLMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
13.3 GLM 1: Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.4 GLM 2: Ordinal Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . 270
13.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
14 Bayesian Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
14.1 Bayesian Versus Frequentist Interpretation . . . . . . . . . . . . . . . . . . . 275
14.2 The Bayesian Approach in the Age of Computers . . . . . . . . . . . . . 277
14.3 Example: Markov-Chain-Monte-Carlo Simulation . . . . . . . . . . . . 278
14.4 Summing Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

Appendix A: Useful Programming Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283


Appendix B: Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Appendix C: Equations for Confidence Intervals . . . . . . . . . . . . . . . . . . . . . 321
Appendix D: Web Ressources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Abbreviations

ACF Auto-Correlation Function


AIC Akaike Information Criterion
ANOVA ANalysis Of VAriance
ARIMA Autoregressive Integrated Moving Average model
ARMA Autoregressive Moving Average model
BIC Bayesian Information Criterion
CDF Cumulative Distribution Function
CI Confidence Interval
CQ Code Quantlet
DF/DOF Degrees of Freedom
EOL End Of Line
GLM Generalized Linear Models
GUI Graphical User Interface
HDF5 Hierarchical Data Format 5
HSD Honest Significant Difference
HTML HyperText Markup Language
IDE Integrated Development Environment
IQR Inter-Quartile-Range
ISF Inverse Survival Function
ISO International Organization for Standardization
ISP2e https://github.com/thomas-haslwanter/statsintro-python-2e/tree/mas
ter/src/code_quantlets
JPEG Joint Photographic Experts Group
KDE Kernel Density Estimation
MCMC Markov Chain–Monte Carlo
NAN Not-A-Number
NPV Negative Predictive Value
OLS Ordinary Least Squares
PACF Partial Auto-Correlation Function
PDF Probability Density Function
PMF Probability Mass Function

xv
xvi Abbreviations

PNG Portable Network Graphics


PPF Percentile Point Function
PPV Positive Predictive Value
QQ-Plot Quantile-Quantile Plot
ROC Receiver Operating Characteristic
RVS Random Variate Sample
SARIMAX Seasonal Autoregressive Integrated Moving Average Exogenous
model
SD Standard Deviation
SE/SEM Standard Error (of the Mean)
SF Survival Function
SQL Structured Query Language
SS Sum of Squares
SVG Scalable Vector Graphics
TSA Time Series Analysis
Tukey HSD Tukey Honest Significant Difference test
Part I
Python and Statistics

The first part of the book presents an introduction to statistics based on Python. It
is impossible to cover the whole language in thirty or forty pages, so if you are
a beginner, please see one of the excellent Python introductions available on the
Internet for details. Links are given below. This part is a kick-start for Python; it
shows how to install Python under Windows, Linux, or MacOS, and walks step-by-
step through documented programming examples. Tips are included to help avoid
some of the problems frequently encountered while learning Python.
Because most of the data for statistical analysis are commonly obtained from text
files, Excel files, or data preprocessed by Matlab, the third chapter presents simple
ways to import these types of data into Python.
The last chapter of Part I illustrates various ways of visualizing data in Python.
Since the flexibility of Python for interactive data analysis has led to a certain com-
plexity that can frustrate new Python programmers, code samples for various types
of interactive plots should help future Pythonistas to avoid these problems.
Chapter 1
Introduction

Statistics is the explanation of variance in the light of what


remains unexplained (anon).

1.1 Why Statistics?

Every day, we are confronted with situations with uncertain outcomes, and must
make decisions based on incomplete data: “Should I run for the bus? Which stock
should I buy? Which man should I marry? Should I take this medication? Should
I have my children vaccinated?” Some of these questions are beyond the realm
of statistics (“Which person should I marry?”), because they involve too many
unknown variables. But in many situations, statistics can help extract maximum
knowledge from information given, and clearly spell out what we know and what
we don’t know. For example, it can turn a vague statement like “This medication
may cause nausea,” or “You could die if you don’t take this medication” into a spe-
cific statement like “Three patients in one thousand experience nausea when taking
this medication,” or “If you don’t take this medication, there is a 95% chance that
you will die.”
Without statistics, the interpretation of data can quickly become massively flawed.
Take, for example, the estimated number of German tanks produced during World
War II, also known as the “German Tank Problem.” The estimate of the number of
German tanks produced per month from standard intelligence data was 1550; how-
ever, the statistical estimate based on the number of tanks observed was 327, which
was very close to the actual production number of 342 (http://en.wikipedia.org/wiki/
German_tank_problem).
Similarly, using the wrong tests can also lead to erroneous results.

c Springer Nature Switzerland AG 2022 3


T. Haslwanter, An Introduction to Statistics with Python, Statistics and Computing,
https://doi.org/10.1007/978-3-030-97371-1_1
4 1 Introduction

In general, statistics will help to


• Clarify the question.
• Identify the variable and the measure of that variable that will answer that ques-
tion.
• Determine the required sample size.
• Describe variation.
• Make quantitative statements about estimated parameters.
• Make predictions based on your data.
Reading the book: Statistics was originally invented—like so many other
things—by the famous mathematician C. F. Gauss, who said about his own work,
“Ich habe fleissig sein müssen; wer es gleichfalls ist, wird eben so weit kommen.”
(“I had to work hard; if you work hard as well, you, too, will be successful.”) Just as
reading a book about playing the piano won’t turn you into a great pianist, simply
reading this book will not teach you statistical data analysis. If you don’t have your
own data to analyze, you need to do the exercises included. Should you become frus-
trated or stuck, you can always check the sample solutions provided in Appendix.
Exercises: Solutions to the exercises provided at the end of most chapters can be
found in Appendix. In my experience, very few people work through large numbers
of examples on their own, so I have not included additional exercises in this book.
If the information here is not sufficient, additional material can be found in other
statistical textbooks and on the web.
Books: There are a number of good books on statistics. My favorite is (Altman
1999): it does not dwell on computers and modeling, but gives an extremely useful
introduction to the field, especially for life sciences and medical applications. Many
formulations and examples in this manuscript have been taken from that book. A
more modern book, which is more voluminous and, in my opinion, a bit harder to
read, is (Riffenburgh 2012). Kaplan (2009) provides a simple introduction to modern
regression modeling. If you know your basic statistics, a very good introduction
to Generalized Linear Models can be found in Dobson and Barnett (2018), which
provides a sound, advanced treatment of statistical modeling.
WWW: On the web, you will find very extensive information on statistics in
English at

• http://www.statsref.com/
• http://www.vassarstats.net/
• http://www.biostathandbook.com/
• http://onlinestatbook.com/2/index.html
• http://www.itl.nist.gov/div898/handbook/index.htm.

A good German web page on statistics and regulatory issues is


http://www.reiter1.com/.
I hope to convince you that Python provides clear and flexible tools for most of
the statistical problems that you will encounter, and that you will enjoy using it.
1.3 Accompanying Material 5

1.2 Conventions

The following conventions will be used.

• Text that is to be typed in on the computer is written in Courier font, e.g.,


plot(x,y).
• Optional text in command-line entries is expressed with <...>,
e.g., <InstallationDir>.
• Names referring to computer programs and applications are written in italics, e.g.,
Jupyter.
• Italics will also be used when introducing new terms or expressions for the first
time.
• Really important points that should definitely be remembered are indicated as
follows:

This will be important!

1.3 Accompanying Material

All the examples and solutions shown in this book are available online. This
includes code samples and example programs, Jupyter Notebooks with additional
or extended information, as well as the data and Python code used to generate many
of the figures. They can be downloaded from GitHub
https://github.com/thomas-haslwanter/statsintro-python-2e
which is organized in folders:

data Raw data required for running the programs.


resources Images used by this repository.
ipynbs Jupyter Notebooks with examples, and with additional or
extended information that goes beyond the content pre-
sented in the book.
src/exercise_solutions Solutions to the exercises that are presented at the end of
most chapters.
src/listings Programs that are explicitly listed in this book.
src/figures Code used to generate the Python figures in the text.
Unless noted otherwise, the source code for
Python figures is available in the source file
F<chapter-#>_<figure-#>_xxx.py. For exam-
ple, Fig. 8.4 can be generated with the Python code in
F8_4_anovaOneway.py
src/code_quantlets Additional code samples.
6 1 Introduction

In this book, references to the src/code_quantlets-directory in this reposi-


tory will be abbreviated with <ISP2e>. Make sure also to look at the file
Errata.pdf in the top folder of that archive, which will be kept up to date with
corrections to any mistakes that are discovered after publication of the book.
Packages on GitHub are called repositories, and can easily be copied to
your computer: when git is installed on your computer, simply type
git clone <RepositoryName> (here, the repository name of
statsintro-python-2e given above) in a command terminal, and the whole
repository—code as well as data—will be “cloned” to your system. Alternatively,
you can download a ZIP-archive from there to your local system.
Chapter 2
Python

Python is free, consistently and completely object oriented, and has a large num-
ber of (free) scientific toolboxes (e.g., http://www.scipy.org/). It is used by Google,
NASA, and many others. Information on Python can be found under http://www.
python.org/. If you want to use Python for scientific applications, currently the best
way to get started is with a Python distribution, either WinPython, or Anaconda
from Continuum Analytics. These distributions contain the complete scientific and
engineering development software for numerical computations, data analysis, and
data visualization based on Python. They also come with Qt graphical user inter-
faces, and the interactive scientific/development environment Spyder. If you already
have experience with Matlab, the article NumPy for Matlab Users (https://numpy.
org/devdocs/user/numpy-for-matlab-users.html) provides an overview of the simi-
larities and differences between the two languages.
Python is a very-high-level dynamic object-oriented programming language
(Fig. 2.1). It is designed to be easy to program and easy to read. It was started
in 1980, and has since gained immense popularity in a broad range of fields from
web development, system administration, and in science and engineering. Python is
open source, and has become one of the most successful programming languages.
There are three reasons why I have switched from other programming languages to
Python:
1. It is the most elegant programming language that I know.
2. It is free.
3. It is powerful.

© Springer Nature Switzerland AG 2022 7


T. Haslwanter, An Introduction to Statistics with Python, Statistics and Computing,
https://doi.org/10.1007/978-3-030-97371-1_2
8 2 Python

Fig. 2.1 The Python Logo

2.1 Getting Started

2.1.1 Distributions and Packages

The Python core distribution contains only the essential features of a general pro-
gramming language. Python itself is an interpretative programming language, with
no optimization for working with vectors or matrices, or for producing plots. Pack-
ages which extend the abilities of Python must be loaded explicitly. The most impor-
tant packages for scientific applications are numpy, which makes working with vec-
tors and matrices fast and efficient, and matplotlib, which is the most common
package used for producing graphical output. SciPy contains important scientific
algorithms. And pandas has become widely adopted for statistical data analysis. It
provides DataFrames which are labeled, 2D data structures, making work with data
more flexible and intuitive. Python can be used with different front-ends (Fig. 2.2):
from the command line or terminal; interactively, using Jupyter and IPython; and
from “Integrated Development Environments” (IDEs).
IPython provides the tools for interactive data analysis, and Jupyter provides the
different frontends for IPython. IPython lets you quickly display graphs and change
directories, explore the workspace, provides a command history, etc.

Fig. 2.2 Python can be used from different front-ends: from the command line (left), interactively
(center), and from an IDE (right)
2.1 Getting Started 9

Fig. 2.3 The structure of the most important Python packages for statistics

Figure 2.3 shows the modular structure of the most important Python packages
that are used in this book.
To facilitate the use of Python, so-called Python distributions collect matching
versions of the most important packages, and I strongly(!) recommend using one
of these distributions when getting started. Otherwise, one can easily become over-
whelmed by the huge number of Python packages available. My favorite Python
distributions are
• WinPython recommended for Windows users. At the time of writing, the latest
version was 3.10.5
https://winpython.github.io/
• Anaconda by Continuum, for Windows, Mac, and Linux. The latest Anaconda
version at the time of writing was 2020.11, with Python 3.9.
https://www.anaconda.com/products/individual

I am presently using WinPython, which is free and customizable. Anaconda also


runs under Mac OS and Linux, and is free for educational purposes.
The Python code samples in this book expect a Python version ≥ 3.6.
The programs included in this book have been tested under Windows and Linux.
Under Windows, the following package versions have been used:

• python 3.8.9 ... basic Python installation.


• numpy 1.20.2+mkl ... for working with vectors and arrays.
• scipy 1.6.2 ... all the essential scientific algorithms.
• matplotlib 3.4.1 ... the de facto standard module for plotting and visualization.
• pandas 1.2.4 ... adds DataFrames (imagine powerful spreadsheets) to Python.
• seaborn 0.11.1 ... statistical visualization package and visualization.
• pingouin 0.4.0 ... easy-to-use statistics functions to perform the most widely used
statistical tests.
• statsmodels 0.12.2 ... for advanced statistical modeling.
• ipython 7.22.0 ... for interactive work.
• jupyter 1.0.0 ... for interactive work environments, e.g., the JupyterLab, Jupyter
Notebook, or the Qt console.
10 2 Python

All of these packages come with the WinPython and Anaconda distributions.
Additional packages, which may be required by individual applications, can easily
be installed using pip or conda.
a) PyPI—The Python Package Index
The Python Package Index (PyPI) (https://pypi.org/) is a repository of software for
the Python programming language and contains more than 390’000 projects!
Packages from PyPI can be installed easily from the Windows command shell
(cmd) or the Linux terminal with
pip install <package>

To update a package, use


pip install <package> -U

To get a list of all the Python packages installed on your computer, type
pip list

And to show information about a particular package type


pip show <package>

Anaconda uses conda, a more powerful installation manager. But pip also works
with Anaconda.

2.1.2 Installation of Python

While Python and the required packages can be installed manually, it is typically
much easier to start out with a complete Python distribution.
a) Under Windows
Neither WinPython nor Anaconda require administrator rights for installation.
WinPython In the following, I assume that <WinPythonDir> is the installation
directory for WinPython.
Tip: Do NOT install WinPython into the Windows program directory (typically
C:\Program Files or C:\Program Files (x86)), because this can lead
to permission problems during the execution of WinPython.
• Download WinPython from https://winpython.github.io/.
• Run the downloaded .exe-file, and install WinPython into the
<WinPythonDir> of your choice. (On my own system, I place all programs
that do not modify the Windows Registry, such as WinPython, vim, and ffmpeg,
into a folder C:\Programs.)
• After the installation, make a change to your Windows Environment, by typing
Win -> env -> Edit environment variables for your
account (Note that this is different from the system environment!):
2.1 Getting Started 11

– Add the directories


<WinPythonDir>\python-3.8.9.amd64;
<WinPythonDir>\python-3.8.9.amd64\Scripts\;
(or whatever your Python version number is) to your PATH. (This makes
Python and IPython accessible from the standard Windows command line,
which can be reached quickly by typing Win+cmd.)
– Remove the default
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps from
the PATH (since it contains a misleading python.exe-link).
– If you do have administrator rights, you should activate
<WinPythonDir>\WinPython Control Panel.exe ->
Advanced -> Register Distribution.
(This associates .py-files with this Python distribution.)
Anaconda
• Download Anaconda from
https://www.anaconda.com/distribution/.
• Follow the installation instructions from the web page. During the installation,
allow Anaconda to make the suggested modifications to your environment PATH.
• After the installation: in the Anaconda Launcher, click update (besides the apps),
in order to ensure that you are running the latest version.
Installing additional packages When I have had difficulties installing additional
packages, I have been saved more than once by the pre-compiled packages Christoph
Gohlke, available under http://www.lfd.uci.edu/~gohlke/pythonlibs/: from there you
can download the <program>.whl file for your current version of Python, and
then install it simply with pip install <program>.whl.
a) Under Linux
The following procedure works on Linux Mint 20.1:
• Download the most recent version of Anaconda.
• Open terminal, and navigate to the location where you downloaded the file to.
• Install Anaconda with bash Anaconda<xx>-y.y.y-Linux-x86.sh
• Update your Linux installation with sudo apt-get update.
Notes to Anaconda
• You do not need root privileges to install Anaconda if you select a user writable
install location, such as ~/Anaconda.
• After the self-extraction is finished, you should add the Anaconda binary directory
to your PATH environment variable.
• As all of Anaconda is contained in a single directory, uninstalling Anaconda is
easy: you simply remove the entire install location directory.
• If any problems remain, Mac and Unix users should look up Johansson’s instal-
lations tips:
https://github.com/jrjohansson/scientific-python-lectures
12 2 Python

b) Under Mac OS X
• Go to https://www.anaconda.com/distribution/.
• Choose the Mac installer (make sure you select the Mac OS X Python 3.x Graph-
ical Installer), and follow the instructions listed beside this button.
• After the installation: in the Anaconda Launcher, click update (besides the Apps),
in order to ensure that you are running the latest version.
After the installation, the Anaconda icon should appear on the desktop. No admin
password is required. This downloaded version of Anaconda includes the Jupyter
Notebook, Jupyter Qt console, and the IDE Spyder.
To see which packages (e.g., numpy, scipy, matplotlib, and pandas) are featured
in your installation, look up the Anaconda Package List for your Python version. For
example, the Python-installer may not include seaborn. To add an additional pack-
age, e.g., seaborn, open the terminal, and enter pip install seaborn.

2.1.3 Installation of R and rpy2

If you have not used R previously, you can safely skip this section. However, if you
are already an avid R user, the following adjustments will allow you to also harness
the power of R from within Python, using the package rpy2.
a) Under Windows
Also, R does not require administrator rights for installation. You can download
the latest version (at the time of writing R 4.1.0) from http://cran.r-project.org/, and
install it into the <RDir> installation directory of your choice.
• After the installation of R, add the following two variables to your Windows Envi-
ronment, by typing
Win -> env -> Edit environment variables for your account:

– R_HOME=<RDir> R-4.1.0
– R_USER=<YourLoginName>
The first entry is required for rpy2. The last entry is not really necessary, just
better style.
with Anaconda While WinPython comes with rpy2 installed, Anaconda comes
without rpy2. So after the installation of Anaconda and R, you should install rpy2
with
• conda install -c conda-forge rpy2.
b) Under Linux
• After the installation of Anaconda, install R and rpy2 with
conda install -c conda-forge rpy2.
2.1 Getting Started 13

2.1.4 Python Resources

My favorite introductory book for scientific applications of Python is Scopatz and


Huff (2015). However, that book does not provide any information on statistics. If
you have some programming experience, the book you are currently reading may be
all you need to get the statistical analysis of your data going. If required, very good
additional information can be found on the web, where tutorials as well as good free
books are available online. The following links are all recommendable sources of
information for starting with Python:

• Python Scientific Lecture Notes If you don’t read anything else, read this!
http://scipy-lectures.org/
• NumPy for Matlab Users Start here if you have Matlab experience
https://numpy.org/doc/stable/user/numpy-for-matlab-users.html
also check
http://mathesaurus.sourceforge.net/matlab-numpy.html
• Lectures on scientific computing with Python Great IPython notebooks, from JR
Johansson.
https://github.com/jrjohansson/scientific-python-lectures
• The Python tutorial The official introduction
http://docs.python.org/3/tutorial
• 7 Steps to Python My own efforts to smoothen the first steps into Python
https://work.thaslwanter.at/py_intro/

When running into a problem while developing a new piece of code, most of
the time I just google; thereby, I stick primarily to the official Python documenta-
tion pages and to http://stackoverflow.com. Also, I have found Python user groups
surprisingly active and helpful!

2.1.5 A Simple Python Program

a) Hello World
Python Shell The simplest way to start Python is to type python on the command
line. (When I say command line, I refer in Windows to the command shell started
with cmd, and in Linux or Mac OS X to the terminal.) Then you can already
start to execute Python commands, e.g., the command to print “Hello World” to the
screen: print('Hello World'). On my Windows computer, this results in
Python 3.8.9 (tags/v3.8.9:0a7dcbd, May 3 2021, 17:27:52)...
Type "help", "copyright", "credits" or "license" for more...
>>> print('Hello World')
Hello World
>>>
14 2 Python

However, most of the time it is more recommendable to start with the IPython/
Jupyter Qt console described in more detail in Sect. 2.3. For example, the Jupyter Qt
console is an interactive programming environment which offers a number of advan-
tages. When you type print( in the Qt console, you immediately see information
about the possible input arguments for the command print.
Python Modules are files with the extension .py, and are used to store Python
commands in a file for later use. Let us create a new file with the name
helloWorld.py, which contains the single line
print('Hello World')

This file can now be executed by typing python helloWorld.py on the


command line.
On Windows, you can actually run the file by double-clicking it, or by simply
typing helloWorld.py, if the extension .py is associated with the local Python
installation. On Linux and Mac OS X, the procedure is slightly more involved. There,
the file needs to contain an additional first line specifying the path to the Python
installation.
#! \usr\bin\python
print('Hello World')

On these two systems, you also have to make the file executable, by typing
chmod +x helloWorld.py

before you can run it with helloWorld.py.


b) square_me
To increase the level of complexity, let us write a Python module that includes a
function definition and prints out the square of the numbers from zero to five. (More
on functions in Sect. 2.2.5.) We call the file L2_1_square_me.py, and it con-
tains the following lines:

Listing 2.1: square_me.py

1 # This file shows the square of the numbers 0-5.


2

3 def squared(x=10):
4 return x**2
5

6 for ii in range(6):
7 print(ii, squared(ii))
8

9 print(squared())

Let me explain what happens in this file, line-by-line:

1 The first line starts with “#”, indicating a comment-line.


2.2 Elements of Scientific Python Programming 15

3–4 These two lines define the function squared, which takes the variable x as
input, and returns the square (x**2) of this variable. If the function is called
with no input, x is by default set to 10. This notation makes it very simple to
define default values for function inputs.
Note: The range of the function is defined by the indentation! This is a fea-
ture loved by many Python programmers, but often found a bit confusing by
newcomers. Here, the last indented line is line 4, which ends the function
definition.
6–7 Here, the program loops over the first 6 numbers. Also, the range of the for-
loop is defined by the indentation of the code.
In line 7, each number and its corresponding square are printed to the output.
9 This command is not indented, and therefore is executed after the for-loop
has ended. It tests if the function call with “()”, which uses the default param-
eter for x, also works, and prints the result.

Notes:

• Since Python starts at 0, the loop in line 6 includes the six numbers from 0 to 5.
• In contrast to some other languages, Python distinguishes the syntax for function
calls from the syntax for addressing elements of an array, etc.: function calls, as
in line 7, are indicated with round brackets (...); and individual elements of
arrays or vectors are addressed by square brackets [...].

2.2 Elements of Scientific Python Programming

Compared to the simple example above, real-world applications involve not only
individual numbers but also vectors and matrices. These, together with the most
important Python data- and file-structures, will be described in this section.

2.2.1 Python Datatypes

Python offers a number of powerful data structures, and it pays off to make yourself
familiar with them. The most common ones are

• Lists to group objects of the same types.


• Numpy Arrays to work with numerical data. (numpy also offers the data type
np.matrix. However, in my experience np.array is the way to go, since
many numerical and scientific functions will not accept input data in matrix
format.)
• Tuples to group objects of different types.
• Dictionaries for named, structured data sets.
• pandas DataFrames for simple import and export of data, and for statistical data
analysis.
16 2 Python

For simple programs, you will mainly work with lists and arrays. Dictionaries are
used to group related information together. And tuples are used primarily to return
multiple parameters from functions.
In the following, we will use for Python code the input/output formatting of
IPython which will be presented in Sect. 2.3.
List [] Lists are typically used to collect items of the same type (numbers,
strings, ...). They are “mutable”, i.e., their elements can be modified.
Note that “+” concatenates lists.
In [1]: myList = ['abc', 'def', 'ghij']

In [2]: myList.append('klm')

In [3]: myList
Out[3]: ['abc', 'def', 'ghij', 'klm']

In [4]: myList2 = [1,2,3]

In [5]: myList3 = [4,5,6]

In [6]: myList2 + myList3


Out[6]: [1, 2, 3, 4, 5, 6]

Array [] vectors and matrices, for numerical data manipulation. They are defined
in numpy. Note that vectors and 1D arrays are different: vectors CANNOT be
transposed! With arrays, “+” adds the corresponding elements; and the array-
method .dot performs a scalar multiplication. (Since Python 3.5, scalar multi-
plications can also be performed with the operator “@”.)
In [7]: import numpy as np
...: myArray2 = np.array(myList2)
...: myArray3 = np.array(myList3)

In [8]: myArray2 + myArray3


Out[8]: array([5, 7, 9])

In [9]: myArray2.dot(myArray3)
Out[9]: 32

In [10]: myArray2 @ myArray3


Out[10]: 32

Tuple ( ) A collection of different things. Once created, tuples cannot be modi-


fied. (This really irritated me when I started to work with Python. But since I use
tuples almost exclusively to return parameters from functions, this has not turned
out to be any real limitation.)
In [11]: import numpy as np

In [12]: myTuple = ('abc', np.arange(0,3,0.2), 2.5)


In [13]: myTuple[2]
Out[13]: 2.5
2.2 Elements of Scientific Python Programming 17

Dictionary { } Dictionaries are unordered (key/value) collections of content, where


the content is addressed as dict['key']. Dictionaries can be created with the
command dict, or by using curly brackets {...}:
In [14]: myDict = dict(one=1, two=2, info='some information')

In [15]: myDict2 = {'ten':1, 'twenty':20, info':'more


information'}

In [16]: myDict['info']
Out[16]: 'some information'

In [17]: myDict.keys()
Out[17]: dict_keys(['one', 'info', 'two'])

DataFrame Data structure optimized for working with named, statistical data. It
is defined in pandas. (See Sect. 2.2.4.)

2.2.2 Indexing and Slicing

The rules for addressing individual elements in Python lists, tuples, or numpy arrays
have been nicely summarized by Greg Hewgill on stackoverflow1 :
a[start:end] # items start through end-1
a[start:] # items start through the rest of the array
a[:end] # items from the beginning through end-1
a[:] # a copy of the whole array

There is also the step value, which can be used with any of the above:
a[start:end:step] # start up to end, by step

The key points to remember are that indexing starts at 0, not at 1; and the :end
value represents the first value that is not in the selected slice. So, the difference
end - start is the number of elements selected (if step is 1, the default).
start or end may be a negative number. In that case the count goes from the end
of the array instead of the beginning. So
a[-1] # last item in the array
a[-2:] # last two items in the array
a[:-2] # everything except the last two items

As a result, a[:5] gives you the first five elements (Hello in Fig. 2.4), and a[-5:]
the last five elements (World).

1 http://stackoverflow.com/questions/509211/explain-pythons-slice-notation.
18 2 Python

Fig. 2.4 The expressions in the top row indicate possible notations to select elements of a list or
an array. Indexing starts at 0, and slicing does not include the last value

2.2.3 Numpy Vectors and Arrays

numpy is the Python module that makes working with numbers efficient. It is com-
monly imported with
import numpy as np

By default, it produces vectors. The commands most frequently used to generate


numbers are as follows:

np.zeros generates numpy arrays containing zeros. Note that it takes only one(!)
input. If you want to generate a matrix of zeroes, this input has to be a tuple or a
list, containing the number of rows/columns!
In [1]: import numpy as np

In [2]: np.zeros(3)
# by default numpy-functions generate 1D-vectors
Out[2]: array([ 0., 0., 0.])

In [3]: np.zeros( [2,3] )


Out[3]: array([[ 0., 0., 0.],
[ 0., 0., 0.]])

np.ones generates numpy arrays containing ones.


np.random.randn generates normally distributed numbers, with a mean of 0 and
a standard deviation of 1. To produce reproducible random numbers, you have to
specify the starting point for the random number generation, for example, with
np.random.seed(...), using an integer number of your choice.
np.arange generates a range of numbers. Parameters can be
start, end, steppingInterval. Note that the end value is excluded! While
this can sometimes be a bit awkward, it has the advantage that consecutive
sequences can be easily generated, without any overlap, and without missing
any data points:
In [4]: np.arange(3)
Out[4]: array([0, 1, 2])

In [5]: xLow = np.arange(0, 3, 0.5)


2.2 Elements of Scientific Python Programming 19

In [6]: xHigh = np.arange(3, 5, 0.5)

In [7]: xLow
Out[7]: array([ 0., 0.5, 1., 1.5, 2., 2.5])

In [8]: xHigh
Out[8]: array([ 3., 3.5, 4., 4.5])

np.linspace generates linearly spaced numbers


In [9]: np.linspace(0, 10, 6)
Out[9]: array([ 0., 2., 4., 6., 8., 10.])

np.array generates a numpy array from given numerical data, and is a convenient
notation to enter small matrices
In [10]: np.array([[1,2], [3,4]])
Out[10]: array([ [1, 2],
[3, 4] ])

There are a few points that are peculiar to Python, and that are worth noting:

matrices are simply “lists of lists”. Therefore, the first element of a matrix gives
you the first row, the second element the second row, etc.:
In [11]: Amat = np.array([ [1, 2],
[3, 4] ])

In [12]: Amat[0]
Out[12]: array([1, 2])

Warning: A vector is not the same as a 1D matrix! This is one of the few features
of Python that is not intuitive (at least to me), and can lead to mistakes that are
hard to find. For example, vectors cannot be transposed, but matrices can.
In [13]: x = np.arange(3)

In [14]: Amat = np.array([ [1,2], [3,4] ])

In [15]: x.T == x
Out[15]: array([ True, True, True])
# This indicates that a vector stays a vector, and that
# the transposition with ''.T'' has no effect on
# its shape

In [16]: Amat.T == Amat


Out[16]: array([[ True, False],
[False, True]])

np.r_ Useful command to quickly construct small row vectors. But I only use
it to try things out quickly. In my programs, I prefer the clearer but equivalent
np.array([...])
20 2 Python

In [17]: np.r_[1,2,3]
Out[17]: array([1, 2, 3], dtype=int32)

np.c_ Useful command to quickly build up small column vectors. Note that
column-vectors can also be generated with the command np.newaxis:
In [18]: np.c_[[1.5,2,3]] # note the double brackets!
Out[18]: array([[1.5],
[2. ],
[3. ]])

In [19]: x[:, np.newaxis]


Out [19]: array([[0],
[1],
[2]])

np.atleast_2d Converts a vector (which cannot be transposed; see above) to the


corresponding 2D array (which can be transposed):
In [20]: x = np.arange(5)

In [21]: x
Out[21]: array([0, 1, 2, 3, 4])

In [22]: x.T
Out[22]: array([0, 1, 2, 3, 4]) # no effect on 1D-vectors

In [23]: x_2d = np.atleast_2d(x)

In [24]: x_2d.T
Out[24]: array([[0],
[1],
[2],
[3],
[4]])

np.column_stack An elegant command to generate column matrices:


In [25]: x = np.arange(3)

In [26]: y = np.arange(3,6)

In [27]: np.column_stack( (x,y) )


Out[27]: array([[0, 3],
[1, 4],
[2, 5]])

2.2.4 pandas DataFrames

pandas (http://pandas.pydata.org/) is a widely used Python package, and provides


data structures suitable for statistical analysis and data manipulation. It also adds
2.2 Elements of Scientific Python Programming 21

Fig. 2.5 pandas DataFrame

functions that facilitate data input, data organization, and data manipulation. pandas
is commonly imported with
import pandas as pd
The official pandas documentation contains a very good “Getting started” section:
https://pandas.pydata.org/docs/getting_started/.
a) Basic Syntax of DataFrames
Especially in statistical data analysis (read “data science”), panelled data structures
(→ “pandas”) have turned out to be immensely useful. To handle such labeled data
in Python, pandas introduces so-called “DataFrame” objects. A DataFrame is a 2D
labeled data structure with columns of potentially different types. You can think of
it as a spreadsheet or SQL table (see Fig. 2.5). DataFrames are the most commonly
used pandas objects.
For statistical analysis, pandas becomes really powerful when combined with the
package statsmodels (https://www.statsmodels.org/).
pandas DataFrames can have some distinct advantages over numpy arrays:
• A numpy array requires homogeneous data. In contrast, with a pandas
DataFrame you can have a different data type (float, int, string, datetime, etc.)
in each column (Fig. 2.6).
• pandas has built-in functionality for a lot of common data-processing applica-
tions: for example, easy grouping by syntax, easy joins (which are also really
efficient in pandas), and rolling windows.
• DataFrames, where the data can be addressed with column names, can help a lot
in keeping track of your data.
22 2 Python

Fig. 2.6 Demonstration of some features of pandas DataFrames in JupyterLab (see Sect. 2.3.2).
Unlike np.array, a pd.DataFrame can be used to combine different data types (here, strings,
floats, integers, and dates: commands 2–4). It also can work efficiently with date and time data
(commands 2 and 6, also note the output of “6” in the “Output View” on the right. This is a new
feature of JupyterLab)

In addition, pandas has excellent tools for data input and output.
Let me start with a specific example, by creating a DataFrame with three columns
called “Time”, “x”, and “y”:
import numpy as np
import pandas as pd

t = np.arange(0, 10, 0.1)


x = np.sin(t)
y = np.cos(t)

df = pd.DataFrame({'Time':t, 'x':x, 'y':y})

In pandas, rows are addressed through indices, and columns through their name.
To address the first column only, you have two options:
df.Time
df['Time']

To extract two columns at the same time, put the variable names in a list. With the
following command, a new DataFrame data is generated, containing the columns
Time and y:
data = df[['Time', 'y']]
2.2 Elements of Scientific Python Programming 23

After reading in the data, it is good practice to check if the data have been read
in correctly. The first or last few rows can be displayed with
data.head()
data.tail()

For example, the following statement shows the 5th − 10th row (note that these
are 6 rows):
data[4:10]

as 10 − 4 = 6. (I know, the array indexing takes some time to get used to. It helps
me to think of the indices as pointers to the elements, and that they start at 0. see
Fig. 2.4)
The handling of DataFrames is somewhat different from the handling of numpy
arrays. For example, (numbered) rows and (labeled) columns can be addressed
simultaneously as follows:
df[['Time', 'y']][4:10]

The standard row/column notation can be used by applying the method iloc:
df.iloc[4:10, [0,2]]

Finally, sometimes one wants direct access to the data, not to the DataFrame.
This can be achieved with
data.values

which returns a numpy array if all data have the same data type.
b) Note: Data Selection
While pandas’ DataFrames are similar to numpy arrays, their philosophy is differ-
ent. The numpy syntax comes from the mathematical description of n-dimensional
matrices. In contrast, pandas has its origin in the data analysis of column-oriented
database information. Some of the differences between the two that you should
watch out for are

• numpy handles “rows” first. For example, data[0] is the first row of an array.
• pandas starts with the columns. For example, df['values'][0] is the first ele-
ment of the column 'values'.
• If a DataFrame has labeled rows, one can extract, for example, the row “row_label”
with df.loc['row_label']. If one wants to address a row by its number, e.g.,
row number “15”, one can use df.iloc[15]. And iloc can be used to address
“rows/columns”, e.g., df.iloc[2:4,3].
• Slicing of rows also works, e.g., df[0:5] for the first 5 rows. A sometimes con-
fusing convention is that if you want to slice out a single row, e.g., row “5”, you
have to use df[5:6]. df[5] raises an error!
24 2 Python

Code:ISP_showPandas.py2 demonstrates some of pandas


powerful functions for handling missing data, and for grouping and pivoting data
items.

2.2.5 Functions, Modules, and Packages

Python has three different levels of modularization:


Functions are defined by the keyword def, and can be defined anywhere in
Python. They return the object in the return statement, typically at the end of
the function.
Modules are files with the extension .py. Modules can contain function- and
variable- definitions, as well as valid Python statements.
Packages are folders containing multiple Python modules, and must contain a
file named __init__.py. For example, numpy is a Python package. Since
packages are mainly important for grouping a larger number of modules, they
won’t be discussed in this book.
a) Functions
A function is a set of statements that take inputs, do some specific computation, and
produce output. The idea is to group commonly or repeatedly done tasks and make
a function, so that instead of writing the same code again and again for different
inputs we can call the function. In Python, functions can be declared at any point in
a program with the command def.
A short application example is given in Listing 2.2. Note that in the function
definition so-called “type hints” are used (line 11) to indicate input and return type.
They are optional, but make the code easier to read and understand.
Listing 2.2: python_module.py

1 """ Demonstration of a Python Function """


2
3 # author: Thomas Haslwanter
4 # date: June-2022
5

6 # Import standard packages


7 import numpy as np
8 from typing import Tuple
9

10

11 def income_and_expenses(data : np.ndarray) -> Tuple[float,


float]:

2 <ISP2e>/02_GettingStarted/ISP_showPandas.py.
2.2 Elements of Scientific Python Programming 25

12 """Find the sum of the positive numbers, and the sum of


the negative ones.
13

14 Parameters
15 ----------
16 data : numpy array (,n)
17 Incoming and outgoing account transactions
18

19 Returns
20 -------
21 income : Sum of the incoming transactions
22 expenses : Sum of the outgoing account transactions
23 """
24

25 income = np.sum(data[data>0])
26 expenses = np.sum(data[data<0])
27
28 return (income, expenses)
29

30

31 if __name__=='__main__':
32 testData = np.array([-5, 12, 3, -6, -4, 8])
33

34 # If only real banks would be so nice ;)


35 if testData[0] < 0:
36 print('Your first transaction was a loss and is
dropped.')
37 testData = np.delete(testData, 0)
38 else:
39 print('Congratulations: Your first transaction is a
gain!')
40

41 (my_income, my_expenses) = income_and_expenses(testData)


42 print(f'You have earned {my_income:5.2f} EUR, ' + \
43 f'and spent {-my_expenses:5.2f} EUR.')
A detailed description of what happens in this piece of code is given below.
The example in Listing 2.2 shows how functions can be defined and used.
• 1: Module header, commonly written as a multiline comment
("""< x x x > """).
• 3/4: Author and date information (should be separate from the module header).3
• 7: The required Python packages have to be imported explicitly. Here, numpy will
be required, and it is customary to import numpy as np.
• 8: The command Tuple from the package typing will be used in the “type hints”
for the upcoming function. Type hints give hints on the type of the object(s) the
function is using and for its return. They are optional, but improve the readability
of code.
• 9/10: Keep 2 empty lines before function definitions.

3 For the rest of the book, the “author/date” information will be left away, to keep the program
listings more compact.
26 2 Python

• 11: Function signature.


• 12–23: Multiline comment describing the function. It should also include infor-
mation about the parameters the function takes, and about the return elements.
• 11–28: Function definition. Note that in Python the function block is defined by
the indentation, not by any brackets or end statements! This is a feature that irri-
tates many Python novices, but really helps to keep code clear and nicely for-
matted. Important: Python makes a difference between a tab and the equivalent
amount of spaces. This can lead to errors which are really hard to detect, so use a
good IDE that automatically converts tabs to spaces!
• 25:
– The sum command is taken from numpy, so it has to be preceded by np.
– In Python, function arguments are indicated by round brackets (...), whereas
elements of lists, tuples, vectors, and arrays are indicated by square brackets
[...].
– In numpy, you can select elements of an array either with an index (see line
35), or with a Boolean array (lines 25–26).
• 28: Python also uses round brackets to form groups of elements, so-called
“tuples”. And the return statement does the obvious things: it returns elements
from a function.
• 31: Here, quite a few new aspects of Python are introduced:
– Just like function definitions, if-loops or for-loops use indentation to define
their context.
– A convention followed by most Python coders is to prefix variables or methods
that are supposed to be treated as a non-public part of the Python code with an
underscore, for example, _geek or __name__.
– Here, we check the variable with the name __name__, which is automatically
generated by the Python interpreter and indicates the context of a module eval-
uation. If the module is run as a Python script, __name__ is automatically set
to __main__. But if a module is imported (see, e.g., Listing 2.3), it is set to the
name of the importing module. This way it is possible to add code to a function
that is only used when the module is executed, but not when the functions in
this module are imported by other modules (see below). This is a nice way to
test functions defined in the same module.
• 32: Definition of a numpy array.
• 41: The two elements returned as a tuple from the function
income_and_expenses can be simultaneously assigned to two different Python
variables, here to (my_income, my_expenses).
• 42: While there are different ways to produce formatted strings, the “f-strings”
that were introduced with Python 3.6 are probably the most elegant: curly brackets
{} indicate values that will be inserted. The optional expression after the colon
contains formatting statements: here :5.2f indicates “express this number as a
2.2 Elements of Scientific Python Programming 27

float, with 5 digits, 2 of which are after the comma”.4 The corresponding values
are then passed into the f-string for formatted output. And the '\' at the end of
the line indicates a line continuation.
b) Modules
To execute the module L2_2_python_module.py from the command line, type
python L2_2_python_module.py. In Windows, if the extension “.py” is
associated with the Python program, it suffices to double-click the module, or to
type python_module.py on the command line. In WinPython, the association
of the extension “.py” with the Python function can be set by the WinPython Control
Panel.exe, by the command Register Distribution ... in the menu Advanced.
To run a module in IPython, use the magic function %run:
In [1]: %run L2_2_python_module
Your first transaction was a loss and is dropped.
You have earned 23.00 EUR, and spent 10.00 EUR.
Note that you either have to be in the directory where the function is defined, or
you have to give the full path name.
If you want to use a function or variable that is defined in a different module,
you have to import that module. This can be done in three different ways. For the
following example, assume that the other module is called new_module.py, and
the function that we want from there new_function.
• import new_module: The function can then be accessed with
new_module.new_function().
• from new_module import new_function: In this case, the function can be
called directly new_function().
• from new_module import *: This imports all variables and functions from
new_module into the current workspace; again, the function can be called directly
with new_function(). However, use of this syntax is discouraged! It clutters up
the current workspace, and one risks overwriting existing variables with the same
name as an imported variable.
If you import a module multiple times, Python recognizes that the module is
already known and skips later imports.
The next example shows you how to import functions from one module into
another module:
Listing 2.3: python_import.py

1 """ Demonstration of importing a Python module """


2

3 # Import standard packages


4 import numpy as np
5

6 # additional packages: this imports the function from above

4 https://pyformat.info/ contains all the details of formatted output in Python.


28 2 Python

7 import L2_2_python_module as py_func


8

9 # Generate test-data
10 testData = np.arange(-5, 10)
11

12 # Use a function from the imported module


13 out = py_func.income_and_expenses(testData)
14

15 # Show some results


16 print(f'You have earned {out[0]:5.2f} EUR, '+\
17 f' and spent {-out[1]:5.2f} EUR.')

• 7: The module L2_2_python_module (that we have just discussed above) is


imported, as py_func.
• 13: To access the function income_and_expenses from the module
py_func, module- and function-name have to be given:
py_func.income_and_expenses(...). Note that out here contains both return-
variables.

2.3 Interactive Programming—IPython/Jupyter

2.3.1 Workflow

The best way to start a program is to take a paper and pencil and explicitly write
down the algorithms to be implemented! This helps to clarify the required program-
ming steps, which parameters have to be provided explicitly, and which have to be
calculated during the execution of the program. In most cases, this is also the most
efficient way to start the development of a new program.
The next step is to work out the command syntax. In Python, this is best done
with IPython/Jupyter. IPython (http://ipython.org/) provides a programming envi-
ronment that is optimized for interactive computing with Python, similar to the
command line in Matlab. It comes with a command history, interactive data visual-
ization, command completion, and a lot of features that make it quick and easy to
try out code.
Once the individual steps are working, one can use the IPython command
%history to get the commands used. One can use either copy/paste that history, or
save it directly to a file with
%history -f [fname]

Then one can switch to an integrated development environment (IDE), in my


case Wing, to generate the final, working program.
The example in Fig. 2.7 shows the first steps for a program that generates a
sine wave. Underlining the required parameters helps me to see which parameters
need to be defined at the beginning of the program. And spelling out each step
explicitly, e.g., the generation of a time-vector in line 4 in Fig. 2.7, clarifies which
2.3 Interactive Programming—IPython/Jupyter 29

Fig. 2.7 Still, the best start to the successful development of a new program!

additional parameters arise in the program implementation. This approach speeds up


the implementation of a program and is an important first step in avoiding mistakes.

2.3.2 Jupyter Interfaces

While IPython can also be run in a terminal-environment, its full power becomes
available with Jupyter. In 2013 the IPython Notebook, a browser-based frontend for
Python, became a very popular way to share research and results in the Python com-
munity. In 2015, the development of the frontend became its own project, called
Project Jupyter (https://jupyter.org/). Today, Jupyter can be used not only with
Python, but also with Julia, R, and more than 100 other programming languages.
The most important interfaces provided by Jupyter are

• Qt console.
• Jupyter Notebook.
• JupyterLab.

They can be started from a terminal with the command


jupyter <viewer>

where viewer is qtconsole, notebook, or lab.


a) Qt Console
The Qt console (see Fig. 2.8) is my preferred way to start coding, especially to figure
out the correct command syntax. It provides immediate feedback on the command
syntax, and good text completion for commands, file names, and variable names.
30 2 Python

Fig. 2.8 The Qt console, displaying parameter tips for the current command, np.arange

b) Jupyter Notebook
The Jupyter Notebook is a browser-based interface, which is especially well suited
for teaching, documentation, and collaborations. It allows you to combine a struc-
tured layout, equations in the popular LaTeX format, and images, and can include
resulting graphs and videos, as well as the output from Python commands (see
Fig. 2.9). Packages such as plotly (https://plot.ly/) or bokeh (https://bokeh.org/) build
on such browser-based advantages, and allow easy construction of interactive inter-
faces inside Jupyter Notebooks.
Code samples accompanying this book are also available as Jupyter Notebooks,
and can be downloaded from
https://github.com/thomas-haslwanter/statsintro-python-2e.
c) JupyterLab
JupyterLab is the successor to the Jupyter Notebook. As Fig. 2.10 shows, it extends
the Notebook with very useful capabilities such as a file browser, easy access to
commands and shortcuts, and flexible image viewers. The file format stays the same
as the Notebook, and both are saved as .ipynb-files.
2.3 Interactive Programming—IPython/Jupyter 31

Fig. 2.9 The Jupyter Notebook makes it easy to share research, formulas, and results

2.3.3 Personalizing IPython/Jupyter

When working on a new problem, I always start out with the Qt console (see
Fig. 2.8).
In the following, <mydir> has to be replaced with your home directory (i.e., the
directory that opens up when you run cmd in Windows, or terminal in Linux).
And <myname> should be replaced by your name or your userID.
To start up IPython in a folder of your choice, and with personalized startup
scripts, proceed as follows:
a) In Windows
• Type Win+R, and start a command shell with cmd.
• In the newly created command shell, type
ipython profile create.
(This creates the directory <mydir>\.ipython.)
Discovering Diverse Content Through
Random Scribd Documents
shawl just like it once; but come, dear, come; think of my old lord waiting.
We must not lose any more time, Val.”
Dick put his arm round his mother; he thought she was going to faint, so
deadly white was her face—white as the kerchief on her head. She laid her
head on his shoulder, and moaned faintly. Her closed eyes, her blanched
cheeks, her lips falling helplessly apart, gave Dick an impression of almost
death.
“Mother, tell me, for God’s sake, who is this, and what is the matter with
you?” he cried.
CHAPTER XXIII.
“You must hold yourself ready to be called back at a moment’s notice,
Val,” said the old lord. “It must be some time next year, and it may be any
day. That is to say, we can scarcely have it, I suppose, before Parliament
meets, except in some unforeseen case. Therefore see all you can as soon as
you can, and after February hold yourself in readiness to be recalled any
day.”
“Certainly, sir,” said Val, with a blithe assent which was trying to his
grandfather. He was quite ready to do anything that was wanted of him—to
make up his mind on any political subject on the shortest notice, and sign
anything that was thought desirable; but as for personal enthusiasm on the
subject, or excitement in the possibility of being elected member for the
county, I am afraid Val was as little moved as the terrier he was caressing.
Perhaps, however, he was all the more qualified on that account to carry the
traditionary principles of the Rosses to the head of the poll, and to vote as
his fathers had voted before him, when they had the chance,—or would
have voted had they had the chance. Val was setting out on his travels when
this warning was given. He was going to see his father in Florence, and,
under his auspices, to visit Italy generally, which was a very pleasant
prospect. Up to this time he had done the whole duty of boy in this world;
and now he had taken his degree, and had a right to the prouder title of man.
Not that Val was very much changed from his Eton days. He was still
slim and slight, notwithstanding all his boating. His brown complexion was
a trifle browner, if that were possible, with perpetual exposure to the sun;
his hair as full of curls, and as easily ruffled as ever, rising up like a crest
from his bold brown forehead; and I do not think he had yet got his temper
under command, though its hasty flashes were always repented of the
moment after. “A quick temper, not an ill temper,” Lady Eskside said; and
she made out that Valentine Ross, the tenth lord, her husband’s father—he
whose portrait in the library her son called “a Raeburn,” and between whom
and Val she had already attempted to establish a resemblance—was very
hasty and hot-tempered too; which was an infinite comfort to her, as
proving that Val got his temper in the legitimate way—“from his own
family”—and not through that inferior channel, “his mother’s blood.” He
was slightly excited about the visit to his father, and about his first progress
alone into the great world—much more excited, I am sorry to say, than he
was about representing the county; but on that point Lord Eskside did
everything that was necessary, filling up what was wanting on Valentine’s
part in interest and emotion. He had again filled Rosscraig with a party
which made the woods ring with their guns all morning, and talked politics
all night; and there was not a voter of importance in the whole county who
had not already been “sounded,” one way or other, as to how he meant to
dispose of his vote. “The first thing to be done is to make sure of keeping
the Radicals out,” Lord Eskside said; for, indeed, a Whig lawyer was known
to be poising on well-balanced wing, ready to sweep down upon a
constituency which had always been stanch—faithful among the faithless
known. The present Member, I must explain, was in weak health; and but
for embarrassing his party, and thwarting the cherished purpose of Lord
Eskside, who was one of the leading members of the Conservative party in
the county, would have retired before now.
Val’s term of residence at home was not, therefore, much more than a
visit. He did what an active youth could do to renew all his old alliances,
and climbed up the brae to the Hewan many times without seeing any of the
family there, except the younger boys, who were mending of some youthful
complaint under Mrs Moffatt’s care, and who looked up to him with great
awe, but were not otherwise interesting to the young man. “Are any of the
others coming—is your mother coming—or Vi?” said Valentine; but these
youthful individuals could afford him no information. “Oh ay, they’re
maybe coming next month,” said old Jean, who took a feminine pleasure in
the dismay that was visible in Valentine’s face. “They were here a’ the
summer, June and July; and I wouldna wonder but we’ll see them all
October—if it’s no too cauld,” the old woman added, with a twinkle in her
eye.
“What good will that do me?” said Val; and he leapt the dyke and went
home through the ferns angry with disappointment. And yet he was not at
all in love with Violet, he thought, but only liked her as the nicest girl he
knew. When he remarked to Lady Eskside that it was odd to find none of
the Pringles at the Hewan, my lady arose and slew him on the spot. “Why
should the Pringles be at the Hewan?” she said; “they have a place of their
own, where it becomes them much better to be. To leave Violet there so
long by herself last year was a scandal to her mother, and gave much
occasion for talking.”
“Why should it give occasion for talking?” said Val.
“A boy like you knows nothing about the matter,” the old lady answered,
putting a stop to him decisively. Perhaps that was true enough; but it was
also true that Val took a long walk to the linn next day, and sat down under
the beeches, and mused for half an hour or so, without quite knowing what
he was thinking about. How clearly he remembered those two expeditions,
mingling them a little in his recollection, yet seeing each so distinctly! the
small Violet in her blue cloak, sleeping on his shoulder (which thought
made him colour slightly and laugh in the silence, such intimate
companionship being strangely impossible to think of nowadays), and the
elder Violet, still so sweet and young, younger than himself, though he was
the very impersonation of Youth, repeating all the earlier experiences except
that one. “By Jove, how jolly Mary is!” said Valentine to himself at the end
of this reverie; and when he went home he devoted himself to Miss
Percival, who was again at Rosscraig, as she always was when Lady
Eskside was exposed to the strain and fatigue of company. “Do you
remember our picnic at the linn last year?” he said, standing over Mary in a
corner after dinner, to the great annoyance of an elderly admirer, who had
meant to take this opportunity of making himself agreeable to a woman
who seemed the very person to “make an excellent stepmother” to his seven
children. Mary, who was conscious in some small degree of the worthy
man’s meaning, was grateful to Val for once; and enjoyed, as the quietest of
women do, the discomfiture of her would-be suitor.
“Yes,” she said, smiling; “what of it, you unruly boy?”
“I am not a proper subject for such epithets,” said Val. “I have attained
my majority, and made a speech to the tenantry. I say, Mary, do you know,
that’s a lovely spot, that linn. I was there to-day——”
“Oh, you were there to-day?”
“Yes, I was there. Is there anything wonderful in that?” said Val, not sure
whether he ought not to take offence at the laughing tone, which seemed to
imply something. “Tell Violet, when you see her, that it was uncommonly
shabby of her not to come this year. We’d have gone again.”
“There’s a virtue in three times, Val,” said Mary. “If you go again, it will
be more than a joke; and I don’t think I’ll give your message to Vi.”
“Why should it be more than a joke? Or why should it be a joke at all?”
said Val, reddening, he scarcely knew why. He withdrew after this, slightly
confused, feeling as if some chance touch had got at his heart, giving it a
dinnle which was half pleasure and half pain. Do you know what a dinnle
is, dear English reader? It means that curious sensation which you, in the
poverty of your language, call “striking the funny bone.” You know what it
is in the elbow. Valentine had that kind of sensation in his heart; and I think
if this half-painful jar of the nerve lasted, and suggested quite new thoughts
to the boy, it was all Mary Percival’s fault. I am happy to say that her
widower got at her on Val’s withdrawal, and made himself most
overpoweringly agreeable for the rest of the night.
And then the boy went away on his grand tour, leaving the old people at
home rather lonely, longing after him; though Lord Eskside was too much
occupied to take much notice of Val’s departure. My lady was very busy,
too, paying visits all over the country, and paying court to great and small.
She promised the widower her interest with Mary, but judiciously put him
off till Miss Percival’s next visit, saying, cunningly, that she must have time
to prepare her young friend for the idea, and trusting in Providence that the
election might be over before an answer had to be given. It was gratifying
to the Esksides to find a devoted canvasser for Valentine in the person of
Lord Hightowers, the only possible competitor who could have “divided the
party” in the county. Hightowers, however, was not fond of politics, and
had no ambition for public life; it would have suited him better to be a
locksmith, like Louis Seize. And among them all, they got the county into
such a beautiful state of preparation that Lord Eskside could scarcely
contain his rapture—and having laid all his trains, and holding his match
ready, sat down, in a state of excitement which it would be difficult to
describe, to wait until the moment of explosion came.
In other places, too, Valentine’s departure had caused far more
excitement than he was at all aware of. He had seen and said good-bye to
Dick with the most cordial kindness, on the day he left Oxford. But Val had
not failed to remark a gravity and preoccupation about his humble friend
which troubled him in no small degree. When he recounted to Dick the
failure of Lady Eskside and himself on the day before, the young man had
received the information with a painful attempt to seem surprised, which
made Val think for a moment that Dick’s mother had avoided the visit of set
purpose. But as he knew of no hidden importance in this, the idea went
lightly out of his head; and a few days after he remembered it no more. Very
much more serious had been the effect upon Dick. His mother’s flight and
her panic were equally unintelligible to him. The thought that there must be
“something wrong” involved, in order to produce such terror, was almost
irresistible; and Dick’s breeding, as I have said, had been of that practical
kind which makes the mind accustomed to the commoner and vulgarer sorts
of wrong-doing. He did not insist upon knowing what it was that made his
mother afraid of Val’s grandmother; but her abject terror, and the way in
which she dragged him too, out of sight, as if he had been a partner of her
shame, had the most painful effect upon the young man. In the rudimentary
state of morals which existed among the class from which he sprang, and
where all his primitive ideas had been formed, dishonesty was the one
crime short of murder which could bring such heavy shame along with it.
He who steals is shunned in all classes, except among the narrow
professional circles of thieves themselves; and Dick could not banish from
his thoughts a painful doubt and uncertainty about his mother’s relations
with “Mr Ross’s people.” She herself was so stunned and petrified by the
great danger which she seemed to herself to have escaped, that she was very
little capable of giving a rational explanation of her conduct. “You knew
this lady before, mother?” said Dick to her, half pitifully, half severely, as
he took her back to the parlour and placed her in a chair after the visitors
were gone. “Yes,” she answered, but no more. And though he asked her
many other questions, nothing more than repeated Yes and No could he get
in reply.
I do not know what wild sense of peril was in the poor creature’s heart.
She feared, perhaps, that they could have taken her up and punished her for
running away from her husband; she felt sure that they would separate her
from her remaining boy—though had they not the other, whom she had
given up to them? and in her panic at the chance of being found out, all
power of reasoning (if she ever had any) deserted her. Ah, she thought to
herself, only a tramp is safe! As soon as you have a settled habitation, and
are known to neighbours, and can be identified by people about, all security
leaves you: only on the tramp is a woman who wishes to hide herself safe.
In her first panic, the thought of going away again, of deserting everything,
of taking refuge on those open roads—those outdoor bivouacs which are
full in the eye of day, yet better refuges than any mysterious darkness—
came so strongly over her, that it was all she could do to withstand its force.
But when she looked at her son, active and trim, in his boat-building yard,
or saw him studying the little house at night, with his tools in his hand, to
judge where he could put up something or improve something—his mother
felt herself for the first (or perhaps it was the second) time in her life, bound
as it were by a hundred minute threads which made it impossible for her to
please herself. It was something like a new soul which had thus developed
in her. In former times she had done as the spirit moved her, obeying her
impulses whenever they were so strong as to carry everything else before
them. Now she felt a distinct check to the wild force of these impulses. The
blood in her veins moved as warmly as ever, impelling her to go, and she
knew that she was free to go if she would, and that Dick too could be
vanquished, and would come with her, however unwillingly. She was free
to go, and yet she could not. For the first time in her life she had learned
consciously to prefer another to herself. She could not ruin Dick. The
struggle that she maintained with her old self was violent, but it was within
herself, and was known to nobody; and finally, the new woman, the higher
creature, vanquished the old self-willed and self-regarding wanderer. She
set herself to meet the winter with a dogged resolution, feeling less,
perhaps, the absence of that visionary solace which she had found in the
sight of Val, in consequence of the hard and perpetual battle she had to fight
with herself. And, to make it harder, she had not the cheery gratitude and
tender appreciation of the struggle, which had rewarded her much less
violent effort before. Dick was gloomy, overcast, pondering upon the
strange thing that had happened. He could not get over it: it stood between
him and his mother, making their intercourse constrained and unhappy. Had
she robbed the old lady from whom she had fled in so strange a panic?
Short of that, or something of that kind, why, poor Dick thought, should one
woman be so desperately afraid of another? He did not, it is true, say, or
even whisper to himself, this word so terrible to one in his insecure
position, working his way in the world with slow and laborious advances;
but the suspicion rankled in his heart.
All this time, however, his mother neither thought of setting herself right
by telling him what her mystery was, nor once felt that she was wronging
Dick by keeping the secret of his parentage so closely hidden from him. It
did not occur to her that by doing this she was doing an injury to her boy.
The life of gentlefolks—the luxurious and elegant existence into which her
husband had tried to tame her, a wild creature of the woods—had been
nothing but misery to her; and I doubt whether she was capable of realising
that Dick, so different from herself in nature, would have felt differently in
respect to those trammels from which she had fled. Had she been able to
think, she would have seen how—unconsciously, with the instinct of
another race than hers—the boy had been labouring all his life to
manufacture for himself such a poor imitation of those trammels as was
possible to him; but she was little capable of reasoning, and she did not see
it. Besides, he was hers absolutely, and she had a right to him. She had
given up the other, recognising a certain claim of natural justice on the part
of the father of her children; and in so doing she had gone as far as nature
could go, giving up half, with a rending of her heart which had never
healed; but no principle of which she had ever heard called upon her to give
up the whole. The very fact of having made a sacrifice of one seemed to
enhance and secure her possession of the other—and how could she do
better for Dick than she had done for herself? But this question had not
even arisen in her mind as yet. She feared that they had hidden emissaries,
who, if they found her out, might take her remaining child from her; but
that he was anyhow wronged by her silence, or had any personal rights in
the matter, had not yet entered into her brooding, slowly working, confused,
and inarticulate soul.
In one other house besides, Val and his concerns were productive of
some little tumult of feeling—not the least important of the many eddies
with which his stream of life was involved. Mr Pringle was almost as much
excited about the approaching conflict as Lord Eskside. He saw in it
opportunities for carrying out his own scheme, which he called exposure of
fraud, but which to others much more resembled the vengeance of a
disappointed man. He was the bosom friend of the eminent lawyer who
meant to contest Eskside in the Liberal interest, and had no small share in
influencing him to this step. His own acquaintance with the county, in the
position of Lord Eskside’s heir-presumptive in past days, had given him
considerable advantages and much information which a stranger could not
easily command; and with silent vehemence he prepared himself for the
conflict—contemplating one supreme stroke of revenge—or, as he preferred
to think, contemplating a full exposure to the world of the infamous
conspiracy against his rights and those of his children, from which the
county also was now about to suffer. He did not speak freely to his family
of these intentions, for neither his wife nor his children were in harmony
with him on the subject; but this fact, instead of inducing him to reconsider
a matter which appeared to other eyes in so different a light, increased the
violence of his feelings, just in proportion to the necessity he felt for
concealing them. It was even an additional grievance against Valentine, and
the old people who had set Valentine up as their certain successor, that the
lad had secured the friendship of his enemy’s own family. Sandy, who was
by this time a hard-working young advocate, less fanciful and more certain
of success than his father—though a very good son, and very respectful of
his parents, had a way of changing the subject when the Eskside business
was spoken of, which cut Mr Pringle to the quick. He could see that his son
considered him a kind of monomaniac on this subject; and indeed there was
sometimes very serious talk between Sandy and his mother about this idée
fixe which had taken hold upon the father’s mind.
Thus Mr Pringle’s own family set themselves against him; but perhaps
there was not one of them that had the least idea what painful results might
follow except poor little Violet, who was very fond of her father, and in
whose childish heart Val had established himself long ago. She alone was
certain that her father meant mischief—mischief of a deeper kind than mere
opposition to his election, such as Mr Pringle, as tenant of the Hewan and
the land belonging to it, had a right to make if he pleased. Violet watched
him with a painful mixture of dread lest her father should take some
unworthy step, and dread lest Valentine should be injured, contending in her
mind. She could scarcely tell which would have been the most bitter to her;
and that these two great and appalling dangers should be combined in one,
was misery enough to fill her young soul with the heaviest shadows. This
she had to keep to herself, which was still harder to bear, though very usual
in the troubles of youth. Everything which concerns an unrevealed and
nascent love,—its terrors, which turn the very soul pale; its partings, which
press the life out of the heart; its sickness of suspense and waiting,—must
not the maiden keep all these anguishes locked up in her heart, until the
moment when they are over, and when full declaration and consent make an
end at once of the mystery and the misery? This training most people go
through, more or less; but the trial is so much harder upon the little
blossoming woman that the dawnings of the inclination, which she has
never been asked for, are a shame to her, which they are not to her lover.
Violet did not venture to say a word even to her mother of her wish to be at
the Hewan while Val was there—of her sick disappointment when she
found he had gone away without a chance of saying good-bye; and though
she did venture to whisper her fears lest papa might “say something to hurt
poor Val’s feelings,” which was a very mild way of putting it—she got little
comfort out of this suppressed confidence. “I am afraid he will,” Mrs
Pringle said. “Indeed, the mere fact that your papa is Mr Seisin’s chief
friend and right-hand man, will hurt Val’s feelings. I am very sorry, and I
think it very injudicious; for why should we put ourselves in opposition to
the Eskside family? but it cannot be helped, and your papa must take his
way.”
“Perhaps if you were to speak to him,” said Vi, with youthful confidence
in a process, than which she herself knew nothing more impressive, and
even terrible on occasion.
“Speak to him!” said Mrs Pringle; “if you had been married to him as
long as I have, my dear, you would know how much good speaking to him
does. Not that your papa is a bit worse than any other man.”
With this very unsatisfactory conclusion poor Violet had to be satisfied.
But she watched her father as no one else did, fearing more than any one
else. Her gentle little artifices, in which the child at first trusted much, of
saying something pleasant of Val when she had an opportunity—vaunting
his fondness for the boys, his care of herself (in any other case the strongest
of recommendations to her father’s friendship), his respect for Mr Pringle’s
opinions, his admiration of the Hewan—had, she soon perceived, to her
sore disappointment, rather an aggravating than a soothing effect. “For
heaven’s sake, let me hear no more of that lad! I am getting to hate the very
sound of his name,” her father said; and poor Violet would stop short, with
tears springing to her eyes.
CHAPTER XXIV.
Valentine went off gaily upon his journey, without any thought of the
tragic elements he had left behind him. I think, had Dick been still at the
rafts at Eton, his young patron would have proposed to him to accompany
him to Italy in that curious relationship which exists in the novel and drama,
and could perhaps exist in former generations, but not now, among men—as
romantic humble servant and companion. But Dick was grown too
important a man to make any such proposal possible. Valentine dallied a
little in Paris, which he saw for the first time, and made his way in leisurely
manner across France, and along the beautiful Cornice road, as people used
to do in the days before railways were at all general, or the Mont Cenis
tunnel had been thought of. He met, I need not add, friends at every corner
—old “Eton fellows,” comrades from Oxford, crowds of acquaintances of
his own class and kind—a peculiarity of the present age which is often very
pleasant for the traveller, but altogether destroys the strangeness, the
novelty, the characteristic charm, of a journey through a foreign country. A
solid piece of England moving about over the Southern landscape could not
be more alien to the soil on which it found itself than were those English
caravans in which the young men travelled; talking of cricket if they were
given that way—of hits to leg, and so many runs off one bat; or, if they
were boating men, of the last race, or what happened at Putney or at Henley,
while the loveliest scenes in the world flew past their carriage-windows like
a panorama. I think Mr Evelyn saw a great deal more of foreign countries
when he made the grand tour; and even Val, though he was not very learned
in the jargon of the picturesque, got tired of those endless réchauffés of stale
games and pleasures. He got to Florence about a fortnight after he left
England, and made his way at once to the steep old Tuscan palace, with
deeply-corniced roof and monotonous gloom of aspect, which stood in one
of the smaller streets opening into the Via Maggio on the wrong side of the
river. The wrong side—but yet the Pitti palace is there, and certain
diplomatists preferred that regal neighbourhood. Val found a servant, a
bland and splendid Italian major-domo, waiting for him when he arrived,
but not his father, as he had half hoped; and even when they reached the
great gloomy house, he was received by servants only—rather a dismal
welcome to the English youth. They led him through an endless suite of
rooms, half lighted, softly carpeted, full of beautiful things which he
remarked vaguely in passing, to an inner sanctuary, where his father lay
upon a sofa with a luxurious writing-table by his side. Richard Ross sprang
up when he heard his son announced, and came forward holding out his
hand. He even touched Valentine’s face with his own, first one cheek, then
the other,—a salutation which embarrassed Val beyond measure; and then
he bade him welcome in set but not unkindly terms, and began to ask him
about his journey, and how he had left “everybody at home.”
This was only the third time that Val had seen his father, and Richard
was now a man approaching fifty, and considerably changed from the
elegant young diplomatist, who had surveyed with so little favour fourteen
years ago the boy brought back to him out of the unknown. Richard’s first
sensation now on seeing his son was one of quick repugnance. He was so
like—the vagrant woman against whom Mr Ross was bitter as having
destroyed his life. But he was too wise to allow any such feeling to show,
and indeed did his best to make the boy at home and comfortable. He asked
him about his studies, and received Val’s half-mournful confession of not
having perhaps worked so well as he might have done, with an indulgent
smile. “It was not much to be expected,” he said; “boys like you, with no
particular motive for work, seldom do exert themselves. But I heard you
had gained reputation in a still more popular way,” he added; and spoke of
the boat-race, &c., in a way that made Val deeply ashamed of that triumph,
though up to this moment he had been disposed to think it the crowning
triumph of his life. “You were quite right to go in for it, if your inclination
lies that way,” said his bland father. “It is as good a way as another of
getting a start in society.” And he gave Val a list of “who” was in Florence,
according to the usage established on such occasions. He even took the
trouble of going himself to show him his room, which was a magnificent
chamber, with frescoed walls and gilded ceilings, grand enough for a
prince’s reception-room, Val thought; and told him the hours of meals, and
the arrangements of the household generally. “My house is entirely an
Italian one,” he said, “but two or three of the people speak French. I hope
you know enough of that language at least, to get on easily. Your own
servant, of course, will be totally helpless, but I will speak to Domenico to
look after him. If you know anything at all of Italian, you should speak it,”
he added, suavely; “you will find it the greatest help to you in your reading
hereafter. Now I will leave you to rest after your long journey, and we shall
meet at dinner,” said the politest of fathers. Val sat staring before him half
stupefied when he found himself left alone in the beautiful room. This was
not the kind of way in which a son just arrived would be treated at Eskside.
How much he always had to explain to his grandmother, to tell her of, to
hear about! What a breathless happy day the first day at home always was,
so full of talk, news, consultations, interchange of the family nothings that
are nothing, yet so sweet! Val’s journey had only been from Leghorn, no
further, so he was not in the least fatigued; and why he should be shut up
here in his room to rest he had not a notion, any desire to rest being far from
his thoughts. After a while he got up and examined the room, which was
full of handsome old furniture. How he wished Dick had been with him,
who would have enjoyed all those cabinets, and followed every line of the
carvings with interest! Valentine himself cared little for such splendours.
And finally he went out, and found as usual a school-fellow round the first
corner, and marched about the strange beautiful place till it was time for
dinner, and felt himself again.
It was very strange, however, to English—or rather Scotch—Valentine,
to find himself in this Italian house, with a man so polished, so cultivated,
so exotic as his father for his sole companion. Not that they saw very much
of each other. They met at the twelve o’clock breakfast, where every dish
was new to Val, for the ménage was thoroughly Italian; and at dinner on the
days when Richard dined at home. Sometimes he took his handsome boy
with him to great Italian houses, where, in the flutter of rapid conversation
which he could not follow, poor Val found himself hopelessly left out, and
looked as gauche and unhappy as any traditionary lout of his age; and
sometimes Val himself would join an English party at a hotel, where the hits
to leg and the Ladies’ Challenge Cup would again be the chief subjects of
conversation; if not (which was still more dreary) the ladies’ eager
comparing of notes over Lady Southsea’s garden party, or that charming
Lady Mary Northwood’s afternoon teas. On the whole, Val felt that his
father’s banquets were best adapted to the locality; and when a lovely
princess, with jewels as old as her name and as bright as her eyes,
condescended to put up with his indifferent French, the young man was
considerably elated, and proud of his father and his father’s society—as,
when the same fair lady congratulated Richard upon the beaux yeux of
Monsieur son fils, his father was of him.
One of the rare evenings which they spent together, Val informed his
father of Lord Eskside’s eager preparations for the ensuing election, and of
the place he was himself destined to take in the eyes of his county and
country. Richard Ross did not receive this information as his son expected.
His face grew immediately overcast.
“I wonder my father is so obstinate about this,” he said. “He knows my
feeling on the subject. It is the most terrible ordeal a man can be subjected
to. I wish you had let me know, all of you, before making up your minds to
this very foolish proceeding. Parliament!—what should you want with
Parliament at your age?”
“Not much,” said Val, somewhat uneasy to hear his grandfather attacked
by his father, and a little dubious whether it became him to take the old
man’s side so warmly as he wished; “but I hope I shall do my duty as well
as another,” he said, with a little modest pride, “though I have still
everything to learn.”
“Do your duty! stuff and nonsense,” said Richard; “what does a boy of
your age know about duty? Please your grandfather you mean.”
Val felt the warm blood mounting to his face, and bit his lip to keep
himself down. “And if it was so, sir,” he said, his eyes blazing in spite of
himself, “there might be worse things to do.”
Richard stopped short suddenly and looked at him—not at his face, but
into his eyes, which is of all things in the world the most trying to a person
of hot temper. “Ha!” he said, with a soft smile, raising his eyebrows a little
in gentle surprise, “you have a temper, I see! how is it I never found that out
before?”
Val dug his heels into the rich old Turkey carpet; he pressed his nails into
his flesh, wounding himself to keep himself still. One glance he gave at the
perfect calm of his father’s face, then cast down his eyes that he might not
see it. Richard looked at him with amused calculation, as if measuring his
forces, then waited, evidently expecting an outburst. When none came, he
said with that precise and nicely-modulated voice, every tone of which
ministers occasions of madness to the impatient mind—
“Of course, with that face you must have a temper; I should have seen it
at the first glance. But you have learnt to restrain it, I perceive. I
congratulate you—it augurs well for your success in life.”
Then he fell back quite naturally into the previous subject, changing his
tone in a moment to one of polite and perfect ease.
“I am sorry, as I said before, that my father is so obstinate. Why doesn’t
he put in some squire or other whom he might influence as much as he
pleases? But you; I tell you there isn’t such an ordeal in existence.
Everything a man has ever done is raked up.”
“They may rake up as much as they please,” said Val, with a violent
effort, determined not to be outdone by his father in power of self-control.
His voice, however, was unsteady, and so was the laugh which he forced.
“They may rake up what they please; I don’t think they can make much of
that, so far as I am concerned.”
“So far as you are concerned!” repeated Richard, impatiently. “Why, if
your grandaunt made a faux pas a hundred years ago, it would be brought
up against you. You! It was not robbing of orchards I was thinking of. My
father is very foolish; and it is wilful folly, for I told him my sentiments on
the subject.”
“I wish, sir, if it was the same to you, you would remember that my
grandfather—is my grandfather,” said Val, not raising his eyes.
“Oh, very well. He is not my grandfather, you see, and that makes me,
perhaps, less respectful,” said Richard. “You have taken away my comfort
with this news of yours, and it is hard if I may not abuse somebody. Do you
know what an election is? If your great-grandaunt, as I said, ever made a
faux pas——”
“I don’t suppose she did,” said Val. “Why should we be troubled about
the reputation of people who live only in the picture-gallery? I am not afraid
of my grandaunt.”
“It is because you do not know,” said Richard, with a sigh. “Write to
your grandfather, and persuade him to give it up. It is infinitely annoying to
me. Tell him so. I shall not have a peaceful moment till it is over. One’s
whole history and antecedents delivered up to the gossip of a vulgar crowd!
I think my father must have taken leave of his wits.”
And he began to pace about the great dimly-lighted room in evident
perturbation. The rooms in the Palazzo Graziani were all dimly lighted. A
few softly burning lamps, shaded with delicate abâtjours, gave here and
there a silvery glimmer in the midst of the richly-coloured and balmy
darkness—just enough to let you see here a picture, there a bit of tapestry,
an exquisite cabinet, or some priceless “bit” of the sumptuous furniture
which belongs of right to such houses. Richard’s slight figure moving up
and down in this lordly place, with impatient movements, disturbed its calm
like a pale ghost of passions past.
“Every particular of one’s life!” he continued. “I told him so. It is all
very well for men who have never stirred from home. If you want to save us
all a great deal of annoyance, and yourself a great many stings and wounds,
write to your grandfather, and beseech him to give it up.”
“I will tell him that you wish it, sir,” said Val, hesitating; “but I cannot
say that I do myself, or that I distrust his judgment. Will you tell me what
wounds I have to fear should they bring up all my antecedents—every
particular of one’s life?”
Richard eyed his son from the shade in which he stood. Val’s face was in
the full light. It was pale, with a certain set of determination about the
mouth, on which there hovered a somewhat forced smile. He paused a
moment, wondering how to reply. A dim room is an admirable field for
deliberation, with one face in the shade and the other in the light. Should he
settle the subject with a high hand, and put the young man summarily
down? Should he yield? He did neither. He altered his voice again with the
consummate skill of a man trained to rule and make use of even his self-
betrayals, and knowing every possible way of doing so. He laughed softly
as he came back to the table, throwing off his impatience as if it had been a
cloak.
“A snare! a snare!” he said. “If you think I am so innocent as to fall into
it, or if you hope to see me draw a chair to the table and begin, ‘My son,
listen to the story of my life,’ you are mistaken, Val. I am like most other
men. I have done things, and known people whom I should not care to have
talked about—and which will be talked about inevitably if you are set up as
a candidate for Eskside. Never mind! I shall have to put up with it, I
suppose, since my father has set his heart upon it; but I warn you that it may
come harder on you than me; and when I say so I have done. Give me your
photographs, and let me look over them—a crowd of your Eton and Oxford
friends, I suppose.”
Val looked at his father with a question in his eyes, which he tried to put
with his lips, and could not. During all these years he had thought little
enough of his mother. Now and then the recollection that there was such a
person wandering somewhere in the world would come to him at the most
unlikely time—in the middle of the night, in the midst of some moment of
excitement, rarely when he could make any inquiries about her, even had it
been possible for him to utter such inquiries. Now at once these suppressed
recollections rushed into his mind. Here was the fountain-head of
information; and no doubt the story which he did not know, which no one
had ever told him, was what his father feared. “Father,” he began, his mouth
growing dry with excitement, his heart beating so loudly that he could
scarcely hear himself speak.
Probably Richard divined what he was going to say—for Val, I suppose,
had hardly ever addressed him solemnly by this title before. He called him
“Sir,” when he spoke to him, scarcely anything else. Richard stopped him
with a rapid movement of his hand.
“Don’t, for heaven’s sake, speak to me so solemnly,” he said, half
fretfully, half playfully. “Let me look at your photographs. There is a good
man here, by the way, where you should go and get yourself done. The old
people at home would like it, and it might prove a foundation, who knows,
for the fine steel engraving of the member for Eskside, which, no doubt will
be published some day or other. Come round to this side and tell me who
they are.”
The words were stopped on Valentine’s lips; and if any one could have
known how bitter these words were to him, his relinquishment of the
subject would be more comprehensible to them. Are we not all glad to
postpone a disagreeable explanation? “It must be done some time,” we say;
“but why now, when we are tolerably comfortable?” Valentine acted upon
this natural feeling. His sentiments towards his father were of a very
mingled character. He was proud of him; his refinement and knowledge of
the world made a powerful impression upon the boy’s mind; Val even
admired the man who was so completely unlike himself—admired him and
almost disliked him, and watched him with mingled wonder and respect. He
had never had a chance of regarding him with the natural feelings of a child
or forming the usual prejudices on his behalf. He met him almost as one
stranger meets another, and could not but judge him accordingly on his
merits rather than receive him blindly, taking those merits for granted,
which is in most cases the more fortunate lot of a son. His father was only a
relation of whom he knew very little, and with whom he was upon quite
distant and independent, yet respectful terms. They were both glad, I think,
to take refuge in the photographs; and Richard asked with a very good
grace, “Who is this?” and “Who is that?”—through showers of young
Oxford men and younger Etonians. When he had made his way through
them, there was still a little pack of cards to be turned over—photographs
not dignified enough to find a place in any book. Hunter, the gamekeeper,
Harding, the butler, his wife the housekeeper, and many other humble
personages, were amongst them; and Richard turned them over with more
amusement than the others had given him. Suddenly, however, his remarks
came to a dead stop. Val, who was standing close by him, felt that his father
started and moved uneasily in his chair. He said nothing for the moment;
then in a voice curiously unlike his former easy tone, yet curiously
conquered into a resemblance of it, he said, with a little catching of his
breath, “And who is this, Val?”
It was a scrap of an unmounted photograph, a bit cut off from the corner
of a river scene—a portrait taken unawares and unintentionally by a
wandering artist who was making studies of the river. It was Dick Brown’s
mother, as she had been used to stand every day within her garden wall,
looking at Val’s boat as it passed. Val had seen the picture with her figure in
it, and had bought and kept it as a memento of two people in whom he took
so much interest: for by an odd chance Dick was in it too, stooping to push
off a boat from the little pier close by, and very recognisable by those who
knew him, though his face was scarcely visible. “Oh, sir,” said Val,
instinctively putting out his hand for it, “that is nothing. It was taken by
chance. It’s the portrait of a woman at Oxford, the mother of a fellow I
know.”
“A fellow you know—who may that be? is his portrait among those I
have been looking at? This,” said Richard, holding it fast and disregarding
Val’s hand, which was stretched out to take it, “is an interesting face.”
What feelings were in the man’s breast as he looked at it who can tell?
Surprise, almost delirious, though he hid it as he had trained himself to hide
everything; quick-springing curiosity, almost hatred, wild eagerness to
know what his son knew of her. He made that remark about the interesting
face not unfeelingly, but unawares, to fill up the silence, because everything
in him was stirred up into such wild impulses of emotion. The light swam in
his eyes; yet he continued to see the strange little picture thus blown into his
hand as it seemed by some caprice of fate. As for Valentine, he felt a
repugnance incomprehensible to himself to say anything about Dick or his
mother, and could have snatched the scrap of photograph out of his father’s
hand, though he could not tell why.
“Oh, it is not much,” he said—“it is not any one you would know. It is
the mother of a lad I took a great fancy to a few years ago. He was on the
rafts at Eton, and used to do all sorts of things for me. That’s his mother—
and indeed there’s himself in the corner, if you could see him. I found it in a
photograph of the river; and as I knew the people, and it is so seldom one
sees people who are unconscious of their likenesses being taken, I bought it;
but of course it has no interest to any one who does not know the originals,”
and he put out his hand for it again.
“Pardon,” said Mr Ross, serenely—“it has an interest. The face is a very
remarkable face, like one I remember seeing years ago. What sort of a
person was her son?”
By skilful questions he drew from Val all that he knew: the whole story
of Dick’s struggle upwards; of his determination to do well; of the way he
had risen in the world. Val mixed himself as little as he could with the
narrative, but could not help showing unwittingly how much share he had in
it; and at last grew voluble on the subject, flattered by the interest his father
took in it. “You say the son was at the rafts at Eton, and yet this picture was
taken at Oxford. How was that?” said Richard. Val was standing behind him
all this time, and their looks had not met.
“Well, sir,” said Val, “I hope you won’t think, as Grinder did, that it was
my love of what he called low society. If Brown is low society, I should like
to know where to find better.”
“So Grinder said it was your love of low society?”
“He wrote to my grandfather,” said Val, sore at the recollection, “but
fortunately they knew me better; and when I explained everything,
grandmamma, like the old darling she is, sent me ten pounds to buy Brown
a present. I got him some books, and crayons, and carving things——”
“Yes; but you have not told me how this came to be taken at Oxford,”
said Richard, persistent.
“Well, sir, I was going to tell you. I heard that old Styles wanted a man.
Styles, perhaps you recollect him down at—— Yes, that’s him. So I told
him I could recommend Brown, and so could Lichen, who had been captain
of the boats in my time. Lichen of Christ’s-Church. You won’t know his
name? He rowed stroke——”
“Yes, yes; but let us come back to Brown.”
“There is not much more,” said Val, a little disconcerted. “Styles took
him on our recommendation, and hearing what an excellent character he
had—and that’s where he is now. He and his mother have got Styles’ little
house, and the old man’s gone into the country. I shouldn’t wonder if
Brown had the business when he dies. He has got on like a house on fire,”
said Val—“educated himself up from nothing, and would be a credit to any
one. I’ve always thought,” said the lad, with an innocent assumption of
superior insight, “that he cannot have been born a cad, as he seemed, when I
first saw him; for the mother looks as if she had been a lady. You laugh, sir,
but I dare swear it’s true.”
“I was not laughing,” said Richard, bundling up the photographs
together, and handing them over to his son; “indeed, I think you have
behaved very creditably, and shown yourself capable of more than I
thought. Now, my dear fellow, I’m going to work to-night. Take your
pictures. They have amused me very much; and I think you should go to
bed.”
Val had been doing a great deal that day, and I think he was not sorry to
take his father’s advice. He gathered all his treasures together, and bade him
a more cordial good-night than usual, as he went away with his candle
through the dim suite of rooms. As soon as he had turned his back, Richard
Ross pushed away the papers he had drawn before him, and watched the
young figure with its light, walking down the long vista of curtained rooms.
The man was not genial enough to let that same gentle apparition come in
and illuminate with love the equally dim and lonely antechambers of his
heart; but some thrill of natural feeling quickened within him, some strange
movement of unwonted emotion as he looked after the lad, and felt how
wonderful was this story, and how unwittingly, in natural friendliness of his
boyish soul, Val had done a brother’s part to his brother. The idea moved
him more than the reality did. He took up the little photograph again, which
he had kept without Valentine’s knowledge, and gazed at it, but not with
love. “Curse of my life!”—he said to himself, murmuring the words in
sonorous Tuscan, which he spoke like a native; and clenching his teeth as
he gazed at the image of the woman who had ruined him, as he thought. She
to look “as if she had been a lady!”—he laughed within himself secretly and
bitterly at the thought—a lady! the tramp-girl who had been his curse, and
whom he had never been able to teach anything to. When the first
vehemence of these feelings was over, he sat down and wrote a long letter
to his confidential solicitor in London, a man to whom the whole story had
long been known. And I do not think Richard Ross had sound sleep that
night. The discovery excited him deeply, but not with any of the pleasure
with which a man finds what he has lost, with which a husband might be
supposed to discover the traces of his lost wife and child. No; he wanted no
tamed tramp to disgrace him with her presence, no successful mechanic-son
to shame his family: as they had chosen, so let them remain. He had not
even any curiosity, but a kind of instinctive repugnance to his other son.
And yet he was pleased with Valentine, and thought of the boy more kindly,
because he had been kind to his lost brother. How this paradox should be, I
am unable to explain.
CHAPTER XXV.
“So Mr Pringle is on the other side,” said Mary Percival. “Perhaps it is just
as well, considering all things.”
“Why should it be just as well?” said Violet, with a spark of fire lighting
up her soft eyes. “Is unkindness, and opposition among people who ought
to be friends, ever ‘just as well’? You are not like yourself when you say
so;” and a colour which was almost angry rose upon Vi’s delicate cheek.
“My dear, I have never concealed from you that I want to keep you and
Val apart from each other,” said Miss Percival, with an injudicious
frankness which I have never been able to understand in so sensible a
woman; but the most sensible persons are often foolish on one special point,
and this was Mary’s particular weakness.
“Why should we be kept apart?” said Violet, with lofty youthful
indignation. “Nobody can keep us apart—neither papa’s politics nor
anything else outside of ourselves.”
“Vi! Vi! I don’t think that is how a girl should speak of a young man.”
“Oh, I cannot bear you when you go on about girls and young men!”
cried Violet, stamping her small foot in the vehemence of her indignation.
“Is it my fault that I am a girl and Val a boy? Must I not be friends with him
because of that, a thing we neither of us can help, though I have known him
all my life? But we are fast friends,” cried Vi, with magnificent loftiness,
her pretty nostrils dilating, her bright eyes flashing upon her companion.
“Neither of us thinks for a moment of any such nonsense. We were friends
when we were seven years old, and I would not give up my friend, not if he
were twenty young men!”
“You are a foolish little girl, and I am sorry for you, Vi,” said Mary,
shaking her head. “At any rate, because you are fond of Val, that is no
reason for being uncivil to me.”
At these words, as was natural, Violet, with tears in her eyes, flew to her
friend and kissed her, and begged pardon with abject penitence. “But I wish
I had nothing more on my mind than being friends with Val,” the girl said,
sighing, “or the difference of people’s politics. Of course people must differ
in politics, as they do in everything else. I am a Liberal myself. I think that
to resist everything that is new, and cling to everything that is old, whether
they are bad, or whether they are good, is very wrong. To choose what is
best, whether old or new, is surely the right way.”
“Oh, you are a Liberal yourself?” said Mary, amused; “but I don’t doubt
Val could easily turn you into a Conservative, Vi.”
“Val could not do anything of the kind,” said Violet, with some
solemnity. “Of course I can’t have lived to be twenty without thinking on
such subjects. But I wish I had nothing more on my mind than that. Both
Liberals and Conservatives may be fond of their country, and do their best
for it. I don’t like a man less for being a Tory, though I am a Liberal
myself.”
“That is very satisfactory for us Tories, my dear,” said Mary, “and I am
obliged to you for your magnanimity; but what is it then, my pretty Vi, that
you have upon your mind?”
The girl paused and let fall a few sudden tears. “Mary,” she said (for
there was a Scotch tie of kinship between them also which made this
familiarity admissible), “I am so frightened—and I don’t know what I am
frightened at. I feel sure papa means to do something more than any one
knows of, against Val.”
“Against Val! He means to oppose his election, no doubt, and give Lord
Eskside and our side all the trouble possible: we know that,” cried Mary,
who was a politician of the old school. “These are always the tactics of the
party—to give as much trouble, and sow as many heart-burnings as
possible; though they know they have not a chance of success.”
“I suppose it is just what the Tories would do if they were in the same
position,” said Violet, naturally on the defensive. “But all that is nothing to
me,” she cried; “if people like to fight, let them: I don’t mind it myself—the
excitement is pleasant. But, of course, you know better than I do—are you
sure there is nothing more than fair fighting that papa could do to Val?”
“I am sure your papa is not a man to do anything inconsistent with fair
fighting,” said Mary, evasively, her curiosity strongly roused.
This stopped Violet once more. She gave a heavy sigh. “I hear them say
that everything is fair in an election contest, as everything is fair in war.”
“Or love.”
“I don’t understand such an opinion,” said Violet, rising to her feet and
striking her pretty hands together in impatience. “If a thing is wrong once, it
is wrong always. Love! they call that love which can be pushed on by tricks
and lies; and people like you, Mary—people who ought to know better—
say so too. Of course, one knows you cannot think it,” the girl cried, with a
quick-drawn breath, half sob, half sigh.
“Well, dear, I suppose we all give in to the saying of things which we
don’t think,” said Miss Percival, deprecatingly; “but, Vi, you have made me
curious. What is it your father means to do?”
“I wanted to ask you that; what can he do? Can he do anything?” said
Violet. Mary looked at the impulsive girl, not knowing what to answer. Vi
was true as truth itself in her generous young indignation against all
unworthy strategy—and she was “fond of” and “friends with” Val,
according to the childish phraseology which, in this respect at least, she
chose to retain. But still, even Violet’s innocence was a reason for not
trusting her with any admission that Valentine was open to special attack.
She might assail her father with injudicious partisanship, entreating him to
withhold from assaults which he had never thought of making; so that, on
the whole, Mary judged it was judicious to say nothing as to any special
flaw in the young candidate’s armour. She shook her head.
“I cannot think of anything that could be done against Valentine,” she
said. “He has been a good boy, so far as we know; and when a boy is not a
good boy it is always found out. Sir John is to propose him, and Mr Lynton
of the Linn to second,—he could not have a better start; and dear old Lord
Eskside to stand by him, to get his heart’s desire,” said Mary, with a little
glimmer of moisture in her eyes. “You young things don’t think of the old
people. It goes to my heart, after all their disappointments, to think they will
have their wish at last.”
Violet did not make any reply. Though she was a Liberal herself, and
looked upon politics generally from such an impartial elevation of good
sense, it was no small trouble to poor Vi to know that she could not even
pretend to be on Valentine’s side at this great crisis of his life;—could not
go with Lady Eskside’s triumphant party to see him done honour to in the
sight of all men; could not even wear a bit of ribbon, poor child, for his
sake, but must put on the colours of snuffy Mr Seisin, and go with her
mother to the opposition window, and pretend to look delighted at all the
jokes that might be made, and all the assaults upon her friends. Violet
would not allow how deeply she felt this, the merely superficial and
necessary part of the situation; and, in reality, it was as nothing to her in
comparison with the dread in her heart of something more, she knew not
what—some masked battery which her father’s hand was arranging. She
took Mary out to show her the improvements which were being made at the
Hewan, the new rooms which were almost finished, and which would make
of the poor little cottage a rustic villa. Jean Moffatt, whose nest had not
been interfered with, though Mr Pringle had bought the place, came out as
she heard the voices of the ladies, to take her share in the talk. Jean had now
the privileged position of an old servant among the Pringles, and still acted
as duenna and protectress to Violet on many a summer day when that little
maiden escaped alone with her maid from Moray Place. Mr Pringle had
been getting on in his profession during those years; not in its honours, the
tide of which he had allowed to go past him, but in its more substantial
rewards. He was better off, and able to afford himself the indulgence of a
whim; so the Hewan had been bought, half in love, half in hatred. In love,
because the children, and Violet especially, were fond of the little place; and
in hatred, because it commanded the always coveted domain of Eskside.
“You are a Liberal too, I understand, Jean,” said Mary; “you are all Mr
Ross’s enemies up here.”
“I wish he might never have waur enemies,” said old Jean, “and that’s no
an ill wish; but I’ll never disown my principles. I’ve aye been a Leeberal
from the time of the Reform Bill, which made an awfu’ noise in the country.
There’s nane o’ your contests worth speaking o’ in comparison with that.
But I’m real distressed that there’s this opposition now. We’ll no get our
man in, and we’ll make a great deal o’ dispeace; and two folk so muckle
thought of in the county as my lord and my lady might have gotten their
way for once. I canna bide the notion of going again’ Mr Valentine; but he’s
a kindly lad, and will see that, whatever you are, ye maun gang with your
pairty. Lord bless the callant! if it was for naething but yon chicken-pie,
he’s a hantle mair to me than ony Edinburgh advocate that was ever born.
But you see yoursel, Miss Percival, how we’re placed; we maun side with
our ain pairty, right or wrong.”
“Yes, I see the difficulty of the position,” said Mary, laughing, “and I
shall make a point of explaining it to Val.”
“Do that, mem,” said Jean, seriously. She did not see any joke in the
matter, any more than Vi did, whose mind was in a very disturbed state.
“And I suppose your son will be of your mind?” said Mary, not
indisposed to a little gentle canvassing on her own part.
“I couldna undertake to answer for John,” said the old woman; “nor I
wouldna tamper with him,” she added, “for it’s a great responsibility, and he
ought to judge for himself. There’s one thing with men, they tak a bias easy,
and John was never a Leeberal on conviction, as ye may say, like his faither
and me; and he has a’ the cobbling from the House, and a’ the servants’
work, and my lord’s shooting-boots, and so forth, and noo and then
something to do for my lady hersel; so I wouldna say but he might have a
bias. It’s a grand thing to have nae vote,” said Jean, meditatively, “and then
ye can have the satisfaction of keeping to your pairty without harming your
friends on the other side.”
Jean expressed thus the sentiments of a great many people in Eskside on
the occasion of this election. Even some of the great tenant-farmers who
were Liberals, instead of delighting in the contest, as perhaps they ought to
have done, grumbled at the choice set before them, and regretted the
necessity of vexing the Eskside family, old neighbours, by keeping to their
own party. For Val Ross, as they all felt, was on the whole a much more
appropriate representative than “a snuffy old Edinburgh lawyer,” said one
of the malcontents, “with about as much knowledge of the county as I have
of the Parliament House.” “But he knows how to bring you into the
Parliament House, and squeeze the siller out of your pouch and mine,” said
another. The Parliament House in question, gentle Southern reader, meant
not the House of Commons, but the Westminster Hall of Edinburgh, into
which, or its purlieus, it was quite easy to get with Mr Seisin’s help, but not
so easy to get out again. I am afraid, indeed, that as the Liberal party was
weak in the county, and there had been no contest for some time, and no
active party organisation existed, there would have been no attempt to
oppose Valentine at all but for the determination of Mr Pringle, who,
without bringing himself very prominently forward, had kept his party
sharply up to the mark, and insisted upon their action. That they had no
chance of success, or so little that it was not worth calculating upon, they all
acknowledged; but allowed themselves to be pushed on, notwithstanding,
by the ardour of one fierce personal animosity, undisclosed and
unsuspected. Mr Pringle had been gradually winding himself up to this act
of vengeance through many years. I think if other people had recollected the
strange way in which his young supplanter had made his first appearance at
Eskside, or if any sort of stigma had remained upon Val, the feelings of the
heir-presumptive would have been less exaggerated; but to find that
everybody had forgotten these suspicious circumstances—that even his
insinuations as to the lad’s love of low company, though sufficiently
relished for the moment, had produced no permanent impression—and that
the world in general accepted Valentine with cheerful satisfaction as
Richard Ross’s son and Lord Eskside’s heir, without a doubt or question on
the subject,—all this exasperated Mr Pringle beyond bearing. No passionate
resentment and sense of injury like this can remain and rankle so long in a
mind without somehow obscuring the moral perceptions; and the man had
become so possessed by this consciousness of a wrong to set right and an
injury to avenge, that it got the better both of natural feeling and morality.
He did not even feel that the thing he meditated was beyond the range of
ordinary electioneering attack; that it strained every law even of warfare,
and exceeded the revenges permitted to civilised and political men. All this
he would have seen in a moment had the case not been his own. He would
have condemned any other man without hesitation; would have solemnly
pointed out to him the deliberate cruelty of the project, and the impossibility
of throwing any gloss, even of pretended justice, over it. For no virtuous
impulse to punish a criminal, no philanthropic purpose of hindering the
accomplishment of a crime, could be alleged for what he meant to do. The
parties assailed were guiltless, and there was no chance that his assault,
however virulent, could shake poor Val’s real position, however much it
might impair his comfort. He could scarcely, even to himself, allege any
reason except revenge.
Meanwhile Val had been summoned home. He had spent Christmas with
his father, and since then had travelled farther afield, visiting, though with
perhaps not much more profit than attended his tour in Italy, the classic
islands of Greece. It was early spring when the summons reached him to
return without delay, everything in the political horizon being ominous of
change. Val got back in March, when the whole country was excited by the
preliminaries of a general election. He had been so doubtful of the
advantage of the abundant English society he had enjoyed abroad, that he
was comforted to find himself in English society at home, where it was
undeniably the right thing, and natural to the soil. When he arrived at
Eskside there was a great gathering to meet him. His address was to be seen
at full length on every bit of wall in Lasswade and the adjoining villages,
and even in the outskirts of Edinburgh; and the day of nomination was so
nearly approaching that he had scarcely time to shake himself free from the
dust and fatigue of his journey, and to think of the speech which it would be
necessary to deliver in answer to all the pretty compliments which no doubt
would be showered upon him. Val, I am afraid, was a great deal more
concerned about making a good appearance on this occasion, and
conducting himself with proper manly coolness and composure—as if being
nominated for a seat in Parliament was a thing which had already happened
to him several times at least in his career—than about the real entry into
public life itself, the responsibility of an honourable member, or any other
legitimate subject of serious consideration. When he asked after everybody
on his return, the dignified seriousness with which he was told of the
presence of the Pringles at the Hewan did not affect the young man much.
“Ah, you never liked poor Mr Pringle, grandma,” he said, lightly. “I have
little occasion to like him,” said Lady Eskside; “and now that he is the
getter up of all this opposition, the only real enemy you have, my own boy
——”
“Oh, enemy! come, grandma, that is too strong,” said Val. “If I never
have any worse enemy than old Pringle, I shall do. But I am sorry they are
on the other side,” he added, with a boyish thought that his blue colours
would have looked prettier than ever near Violet’s bright locks. He paused a
moment, and then burst out with a laugh. “I wonder if they will put her into
old Seisin’s yellow ribbons,” he cried, quite unaware how dreadfully he was
betraying himself. “Poor Vi!”
Lady Eskside and Mary looked at each other—the one with a little
triumph, the other with horror and dismay. It was my lady whose face
expressed the latter sentiments. She had constantly refused to believe that
Val had ever “thought twice” of Sandy Pringle’s daughter. Even now she
assailed Mary indignantly, as soon as Valentine’s back was turned. “What
did you mean by giving me such a look? Do you mean that a boy like that
cannot think of a girl he has known all his life without being in love with
her? My dear Mary, that is not like you. I was laughing myself, I confess,”
said the old lady, who looked extremely unlike laughter, “at the idea of their
yellow ribbons on Vi’s yellow hair. The little monkey! setting herself up,
forsooth, as a Liberal; I’m glad the colours are unbecoming,” Lady Eskside
concluded, with the poorest possible attempt at a laugh.
Mary made no reply—but she was much more prepossessed in favour of
Val than she had ever been. Women like a man, or even a boy for that
matter, who betrays himself—who has not so much command of his
personal sentiments but that now and then a stray gleam of them breaking
forth shows whereabouts he is. Mary—who had taken Violet under her
protection, determined that not if she could help it should that little girl fall
a victim, as she herself had done—was entirely disarmed by the boyish
ingenuousness of his self-disclosure. She thought with a half sigh, half
smile, once more, as she had thought that summer day by the linn, that this
boy might have been her son had things gone as they should—that he ought
indeed to have been her son. Sometimes this was an exasperating,
sometimes a softening thought; but it came to Mary on this occasion in the
mollifying way.
“Don’t ask me anything about Vi,” she said to Valentine the same
evening. “You know I never approved of too much friendship between you;
she is your enemy’s daughter.”
“What do you call too much friendship?” said Val, indignantly. “If you
think I am going to give her up because her old father is an old fool, and
goes against us, you are very much mistaken. Why, Vi! I have known her
since I was that high—better than Sandy or any of them.”
“Her father is not so dreadfully old,” said Mary, laughing; “and besides,
Val, I don’t put any faith in him; his opposition is a great deal more serious
than you think.”
“Well, I suppose he must stick to his party,” said Val, employing in the
lightness of his heart old Jean’s words; “but I know very well,” he added,
with youthful confidence, “that though he may be forced for the sake of his
party to show himself against me, he wishes me well in his heart.”
“You are convinced of that?”
“Quite convinced,” said Val, with magnificent calm. Indeed I rather
think the boy was of opinion that this was the case in the world generally,
and that however outward circumstances might compel an individual here
and there to appear to oppose him, by way of keeping up his party or
otherwise, yet in their hearts the whole human race wished him well.
CHAPTER XXVI.
It was on a bright spring morning that the nomination of a knight of the
shire to represent Eskshire in Parliament took place in Castleton, the quiet
little country town which was not far from the Duke’s chief seat, and
tolerably central for all the county. The party from Eskside drove over in
state, my lord and my lady, with Miss Percival and Val, in the barouche, and
with four horses in honour of so great an occasion. They were all in high
spirits, with hopes as bright as the morning, though I think Valentine
thought more than once how pleasant it would have been to have had little
Vi sitting bodkin on the front seat of the carriage between himself and his
grandfather. There would have been plenty of room for her, though I don’t
know that this would have been considered quite a dignified proceeding by
my lady. The little town was all astir, and various cheers were raised as
Lord Eskside and Val went into the committee room; and my lady and Mary
went on to the hotel which was in their interest,—a heavy, serious, old, grey
stone house in the market-place close to the hustings, from one of the
windows of which they were to witness the nomination. On the opposite
side stood the other hotel where Mr Seisin’s supporters congregated. When
Lady Eskside took her place at the window specially reserved for her, there
was a flutter of movement among the crowd already assembled, and many
people turned to look at her with interest scarcely less than that with which
they welcomed the candidate and his supporters. Lady Eskside was a great
deal older than when we saw her first; indeed, quite an old lady, over
seventy, as was her husband. But she had retained all her activity, her
lightness of figure and movement, and the light in her eyes, which shone
almost as brightly as ever. The beauty of age is as distinct as, and not less
attractive in its way than, the beauty of youth; the one extremity of life
having, like the other, many charms which fail to us commonplace persons
in the dull middle-ages, the period of prose which intervenes in every
existence. Lady Eskside was a beautiful old woman; her eyes were bright,
her colour almost as sweet and fresh, though a little broken and run into
threads, as when she was twenty; her hair was snowwhite, which is no
disadvantage, but the reverse, to a well-tinted face. She had a soft dove-
coloured bonnet of drawn or quilted satin coming a little forward round her
face, not perched on the top of the head as ladies now wear that necessary
article of dress; and a blue ribbon, of Val’s colours, round her throat,—
though I think, as a matter of choice, she would have preferred red, as
“more becoming” to her snowy old beauty. Mary, you may be sure, was in
Val’s colours too, and was the thorough partisan of the young candidate,
however little she had been the partisan of the boy himself in his natural
and unofficial character. There was a bright fire blazing in the room behind
them to which they could retire when they pleased; and the window was
thrown wide open, so that they might both see and hear.
The hotel opposite—not by any mean such a good one as the Duke’s
Head—was of course in the opposition interest, and blazed with yellow
flags and streamers. At the window there, just before the commencement of
proceedings, several ladies appeared. They did not come in state like Lady
Eskside, for Mr Seisin had no womankind belonging to him; and these
feminine spectators were wives and daughters of his supporters, and not so
enthusiastic in his cause as they were about their own special relations who
intended to perform on the occasion. Among them, in a prominent position,
but keeping back as much as possible, Mrs Pringle and Violet were soon
descried by the ladies opposite. Neither of them wore anything yellow, as
Lady Eskside, with sharp old eyes, undimmed by age, discovered in a
moment. “They are both fair, and yellow is unbecoming to fair people,” she
said, with involuntary cynicism. I do not much wonder that she was severe
upon them; for indeed had they not pretended all manner of kindness and
friendship for her boy? “It is not their fault,” said Mary, apologetically. “I
wonder what you mean by telling me it is not their fault!” cried Lady
Eskside. “Is a man’s wife just his housekeeper, that she should have no
power over him? They should not have let Sandy Pringle make a fool of
himself. They should not have given their consent, and stuck themselves up
there in opposition to the family. I have no patience with such women.” It
was not wonderful that my lady should disapprove; and I don’t think that
two greater culprits in feeling than Mrs Pringle and her daughter were to be
found in all Eskside. They had the satisfaction of knowing that the husband
and father who had driven them to make this appearance was not unaware
of the sentiments with which they regarded it; but that, I think, was all the
comfort these poor ladies had.
Then there came a stir in the crowd, and a thickening and increase of its
numbers, as if more had been poured into a vessel nearly full; and the
candidates and their supporters came up to the hustings. How Lady
Eskside’s heart swelled and fluttered as her handsome boy, a head taller
than his old grandfather, appeared on that elevation over the crowd,
detached from the rest, not only by his position as the hero of the day, but
by his fresh youth, and those advantages of nature which had been so
lavishly bestowed upon him! Lady Eskside looked at him with pride and
happiness indescribable, and kissed her hand to him as he turned to salute
her at her window; but I will not venture to describe the feelings of the
other ladies, when Val, with, they thought, a reproachful look on his
handsome face, took off his hat to them at their opposite window. Mrs
Pringle blushed crimson, and pushed back her chair; and Violet, who was
very pale, bent her poor little head upon her mother’s shoulder and cried.
“Oh, how cruel of papa to set us up here!” sobbed Vi. Mrs Pringle was
obliged to keep up appearances, and checked her child’s emotion
summarily; but she made up her mind that the cause of this distress and
humiliation should suffer for it, though she would not fly in his face by
refusing absolutely to appear. These agitated persons did not find
themselves able to follow the thread of the proceedings as Lady Eskside
did, who did not lose a word that was said, from the speech of Sir John who
proposed Val, down to the young candidate’s own boyish but animated
address, which, and his good looks, and the prestige and air of triumph
surrounding him, completely carried away the crowd. Sir John’s little
address was short, but very much to the purpose. It gave a succinct account
of Val. “Born among us, brought up among us—the representative of one of
the most ancient and honourable families in the county; a young man who
has distinguished himself at the university, and in every phase of life
through which he has yet passed,” said Sir John, with genial kindness. Mr
Lynton, who seconded Val’s nomination, was more political and more
prosy. He went into the policy of his party, and all it meant to do, and the
measures of which he was sure his young friend would be a stanch
supporter, as his distinguished family had always been. Mr Lynton was
cheered, but he was also interrupted and assailed by questions from Radical
members of the crowd, and had a harder time of it than Sir John, who spoke
largely, without touching abstract principles or entering into details. Mr
Lynton was a little hustled, so to speak, and put through a catechism, but on
the whole was not badly received.
Val’s, however, was the speech of the day. He rushed into it like a young
knight-errant, defying and conciliating the crowd in the same breath, with
his handsome head thrown back and his young face bright and smiling. “He
has no end of way on him,” Lord Hightowers said, who stood by, an
interested spectator—or rather, metaphorically, ran along the bank, as he
had done many a day while Val rowed triumphant races, shouting and
encouraging. Val undertook everything, promised everything, with the
confidence of his age. He gave a superb assurance to the Radicals in the
crowd that it should be the aim of his life to see that the intelligence of the
working classes, which had done so much for Great Britain, should have
full justice done to it; and to the tenant-farmer on the other side, that the
claims of the land, and those who produced the bread of the country, should
rank highly in his mind as they ought always to do. The young man
believed that everything could be done that everybody wanted; that all
classes and all the world could be made happy;—what so easy? And he said
so with the sublime confidence of his age, promising all that was asked of
him. When Mr Seisin’s supporters and himself came after this youthful
hero, it is inconceivable what a downfall everybody felt. I am bound to add
that Mr Seisin’s speech read better than Val’s in the paper, and so did that of
his own proposer. But that mattered very little at the moment. Val carried
the crowd with him, even those of them who were a little unwilling, and
tried to resist the tide. The show of hands was triumphantly in his favour.
He was infinitely more Liberal than Mr Seisin, and far more Tory than Sir
John. He thought every wrong could be redressed, and that every right must
conquer: there was no compromise, no moderation, in his triumphant
address.
Lady Eskside and Mary made a progress down the High Street when the
gentlemen went to the committee rooms, and saw the Duchess and the
Dowager-Duchess, who were both most complimentary. These great ladies
had heard Val’s speech, or rather had seen it, being too far off to hear very
much, from their carriage, where they sat on the outskirts of the crowd.
“What fire, what vigour he has!” said the Dowager. “I congratulate you,
dear Lady Eskside; though how you could ever think that boy like his father
——”
“He is not much like your family at all, is he?” said the Duchess-regnant,
with a languid smile. This was the only sting Lady Eskside received during
all that glorious day. The old lord and the young candidate joined them ere
long, and their drive back was still more delightful to the old couple than
the coming. Lord Eskside, however, growled and laughed and shook his
head over Val’s speech. “You’re very vague in your principles,” he said.
“Luckily you have men at your back that know what they are doing. You
must not commit yourself like that, my man, wherever you go, or you’ll
soon get into a muddle.”
“Never mind!” said my lady; “he carried everybody with him; and, once
in the House, I have no fear of his principles; he’ll be kept all right.”
“Luckily for him, the county knows me, and knows he’s all right; though
he’s a young gowk,” said the old lord, looking from under his bended
eyebrows at his hope and pride. They were more pleased, I think, than if Val
had made the most correct of speeches. His exuberance and overflow of
generous youthful readiness for everything made the old people laugh, and
made them weep. They knew, at the other end of life, how these
enthusiasms settle down; but it was delicious to see them spring a perennial
fountain, to refresh the fields and brighten the landscape, which of itself is
arid enough. They looked at each other, and remembered, fifty years back,
how this same world had looked to them—a dreary old world, battered and
worn, and going on evermore in a dull repetition of itself, they knew; but as
they had seen it once, in all the glamour which they recollected, so it
appeared now to Val.
Val himself was so much excited by all that had happened, that he
strolled out alone as soon as he had got free, for the refreshment of a long
walk. It was the end of March: the trees were greening over; the river,
softening in sound, had begun to think of the summer as his banks changed
colour; and the first gowans put out their timid hopeful heads among the
grass. Val went on instinctively to the linn, with a minute wound in his
heart, through all its exhilarations. He thought it very hard that Vi should
not have been near him, that she should not have tied up her pretty hair with
his blue ribbon, that she should have been ranged on the other side. It was
the only unpleasant incident in the whole day, the only drop in his cup that
was not sweet. He explained to himself how it was, and felt that the reason
of it was quite comprehensible; but this gives so little satisfaction to the
mind. “Of course he must stick to his party,” Val murmured to himself
between his teeth; and of course Mrs Pringle and Violet could not go
against the head of the family in the sight of the world at least. When Val
saw, however, a gleam of his own colour between the two great beech-trees

You might also like