100% found this document useful (6 votes)
38 views55 pages

Instant ebooks textbook A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with Applications in Data Analysis and Statistics Gayathri Rajagopalan download all chapters

Data

Uploaded by

yoniskatoax8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (6 votes)
38 views55 pages

Instant ebooks textbook A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with Applications in Data Analysis and Statistics Gayathri Rajagopalan download all chapters

Data

Uploaded by

yoniskatoax8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

A Python Data Analyst’s Toolkit: Learn Python and


Python-based Libraries with Applications in Data
Analysis and Statistics Gayathri Rajagopalan

https://textbookfull.com/product/a-python-data-analysts-
toolkit-learn-python-and-python-based-libraries-with-
applications-in-data-analysis-and-statistics-gayathri-
rajagopalan/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Data Analysis from Scratch with Python Peters Morgan

https://textbookfull.com/product/data-analysis-from-scratch-with-
python-peters-morgan/

textboxfull.com

Data Analysis with Python and PySpark (MEAP V07) Jonathan


Rioux

https://textbookfull.com/product/data-analysis-with-python-and-
pyspark-meap-v07-jonathan-rioux/

textboxfull.com

Python for Data Analysis Data Wrangling with Pandas NumPy


and IPython Wes Mckinney

https://textbookfull.com/product/python-for-data-analysis-data-
wrangling-with-pandas-numpy-and-ipython-wes-mckinney/

textboxfull.com

Python Data Analysis: Perform data collection, data


processing, wrangling, visualization, and model building
using Python 3rd Edition Avinash Navlani
https://textbookfull.com/product/python-data-analysis-perform-data-
collection-data-processing-wrangling-visualization-and-model-building-
using-python-3rd-edition-avinash-navlani/
textboxfull.com
Practical Python Data Visualization: A Fast Track Approach
To Learning Data Visualization With Python Ashwin Pajankar

https://textbookfull.com/product/practical-python-data-visualization-
a-fast-track-approach-to-learning-data-visualization-with-python-
ashwin-pajankar/
textboxfull.com

Python 2 and 3 Compatibility: With Six and Python-Future


Libraries Nanjekye

https://textbookfull.com/product/python-2-and-3-compatibility-with-
six-and-python-future-libraries-nanjekye/

textboxfull.com

Learning Data Mining with Python Layton

https://textbookfull.com/product/learning-data-mining-with-python-
layton/

textboxfull.com

A Tour Of Data Science: Learn R And Python In Parallel


Nailong Zhang

https://textbookfull.com/product/a-tour-of-data-science-learn-r-and-
python-in-parallel-nailong-zhang/

textboxfull.com

Hands-on Scikit-Learn for machine learning applications:


data science fundamentals with Python David Paper

https://textbookfull.com/product/hands-on-scikit-learn-for-machine-
learning-applications-data-science-fundamentals-with-python-david-
paper/
textboxfull.com
A Python Data
Analyst’s Toolkit
Learn Python and Python-based
Libraries with Applications in Data
Analysis and Statistics

Gayathri Rajagopalan
A Python Data
Analyst’s Toolkit
Learn Python and Python-based
Libraries with Applications in Data
Analysis and Statistics

Gayathri Rajagopalan
A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with
Applications in Data Analysis and Statistics
Gayathri Rajagopalan

ISBN-13 (pbk): 978-1-4842-6398-3 ISBN-13 (electronic): 978-1-4842-6399-0


https://doi.org/10.1007/978-1-4842-6399-0

Copyright © 2021 by Gayathri Rajagopalan


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.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Aditee Mirashi
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-6398-3. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
This book is dedicated to my daughter.
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv


Acknowledgments�������������������������������������������������������������������������������������������������xvii

Introduction������������������������������������������������������������������������������������������������������������xix

Chapter 1: Getting Familiar with Python������������������������������������������������������������������ 1


Technical requirements����������������������������������������������������������������������������������������������������������������� 1
Getting started with Jupyter notebooks���������������������������������������������������������������������������������������� 2
Shortcuts and other features in Jupyter���������������������������������������������������������������������������������� 5
Tab Completion������������������������������������������������������������������������������������������������������������������������ 7
Magic commands used in Jupyter������������������������������������������������������������������������������������������ 7
Python Basics������������������������������������������������������������������������������������������������������������������������������� 8
Comments, print, and input����������������������������������������������������������������������������������������������������� 8
Variables and Constants�������������������������������������������������������������������������������������������������������� 11
Operators������������������������������������������������������������������������������������������������������������������������������� 12
Data types����������������������������������������������������������������������������������������������������������������������������� 15
Working with Strings������������������������������������������������������������������������������������������������������������� 20
Conditional statements���������������������������������������������������������������������������������������������������������� 25
Loops������������������������������������������������������������������������������������������������������������������������������������� 26
Functions������������������������������������������������������������������������������������������������������������������������������� 29
Syntax errors and exceptions����������������������������������������������������������������������������������������������������� 31
Working with files����������������������������������������������������������������������������������������������������������������������� 32
Reading from a file���������������������������������������������������������������������������������������������������������������� 33
Writing to a file���������������������������������������������������������������������������������������������������������������������� 34
Modules in Python���������������������������������������������������������������������������������������������������������������������� 35

v
Table of Contents

Python Enhancement Proposal (PEP) 8 – standards for writing code����������������������������������������� 36


Summary������������������������������������������������������������������������������������������������������������������������������������ 38
Review Exercises������������������������������������������������������������������������������������������������������������������������ 39

Chapter 2: Exploring Containers, Classes, and Objects������������������������������������������ 45


Containers����������������������������������������������������������������������������������������������������������������������������������� 45
Lists��������������������������������������������������������������������������������������������������������������������������������������� 45
Tuples������������������������������������������������������������������������������������������������������������������������������������ 56
Dictionaries��������������������������������������������������������������������������������������������������������������������������� 59
Sets��������������������������������������������������������������������������������������������������������������������������������������� 63
Object-oriented programming���������������������������������������������������������������������������������������������������� 65
Object-oriented programming principles������������������������������������������������������������������������������ 67
Summary������������������������������������������������������������������������������������������������������������������������������������ 70
Review Exercises������������������������������������������������������������������������������������������������������������������������ 71

Chapter 3: Regular Expressions and Math with Python����������������������������������������� 77


Regular expressions������������������������������������������������������������������������������������������������������������������� 77
Steps for solving problems with regular expressions����������������������������������������������������������� 77
Python functions for regular expressions������������������������������������������������������������������������������ 79
Using Sympy for math problems������������������������������������������������������������������������������������������������� 86
Factorization of an algebraic expression������������������������������������������������������������������������������� 86
Solving algebraic equations (for one variable)���������������������������������������������������������������������� 87
Solving simultaneous equations (for two variables)�������������������������������������������������������������� 87
Solving expressions entered by the user������������������������������������������������������������������������������� 88
Solving simultaneous equations graphically������������������������������������������������������������������������� 89
Creating and manipulating sets��������������������������������������������������������������������������������������������� 90
Union and intersection of sets����������������������������������������������������������������������������������������������� 90
Finding the probability of an event���������������������������������������������������������������������������������������� 91
Solving questions in calculus������������������������������������������������������������������������������������������������ 92
Summary������������������������������������������������������������������������������������������������������������������������������������ 94
Review Exercises������������������������������������������������������������������������������������������������������������������������ 95

vi
Table of Contents

Chapter 4: Descriptive Data Analysis Basics�������������������������������������������������������� 101


Descriptive data analysis - Steps��������������������������������������������������������������������������������������������� 101
Structure of data����������������������������������������������������������������������������������������������������������������������� 104
Classifying data into different levels����������������������������������������������������������������������������������������� 104
Visualizing various levels of data���������������������������������������������������������������������������������������������� 106
Plotting mixed data������������������������������������������������������������������������������������������������������������� 110
Summary���������������������������������������������������������������������������������������������������������������������������������� 113
Review Exercises���������������������������������������������������������������������������������������������������������������������� 113

Chapter 5: Working with NumPy Arrays��������������������������������������������������������������� 117


Getting familiar with arrays and NumPy functions������������������������������������������������������������������� 117
Creating an array���������������������������������������������������������������������������������������������������������������������� 118
Reshaping an array������������������������������������������������������������������������������������������������������������� 121
Combining arrays���������������������������������������������������������������������������������������������������������������� 125
Testing for conditions���������������������������������������������������������������������������������������������������������� 127
Broadcasting, vectorization, and arithmetic operations������������������������������������������������������������ 130
Obtaining the properties of an array����������������������������������������������������������������������������������������� 133
Slicing or selecting a subset of data����������������������������������������������������������������������������������������� 136
Obtaining descriptive statistics/aggregate measures�������������������������������������������������������������� 138
Matrices������������������������������������������������������������������������������������������������������������������������������������ 140
Summary���������������������������������������������������������������������������������������������������������������������������������� 140
Review Exercises���������������������������������������������������������������������������������������������������������������������� 141

Chapter 6: Prepping Your Data with Pandas��������������������������������������������������������� 147


Pandas at a glance�������������������������������������������������������������������������������������������������������������������� 147
Technical requirements������������������������������������������������������������������������������������������������������������� 149
Building blocks of Pandas��������������������������������������������������������������������������������������������������������� 149
Examining the properties of a Series���������������������������������������������������������������������������������������� 152
DataFrames������������������������������������������������������������������������������������������������������������������������������� 156
Creating DataFrames by importing data from other formats���������������������������������������������� 158
Accessing attributes in a DataFrame���������������������������������������������������������������������������������� 160
Modifying DataFrame objects���������������������������������������������������������������������������������������������� 161
vii
Table of Contents

Indexing������������������������������������������������������������������������������������������������������������������������������������ 169
Type of an index object�������������������������������������������������������������������������������������������������������� 170
Creating a custom index and using columns as indexes���������������������������������������������������� 171
Indexes and speed of data retrieval������������������������������������������������������������������������������������ 173
Immutability of an index������������������������������������������������������������������������������������������������������ 174
Alignment of indexes����������������������������������������������������������������������������������������������������������� 176
Set operations on indexes��������������������������������������������������������������������������������������������������� 177
Data types in Pandas���������������������������������������������������������������������������������������������������������������� 178
Obtaining information about data types������������������������������������������������������������������������������ 179
Indexers and selection of subsets of data�������������������������������������������������������������������������������� 182
Understanding loc and iloc indexers����������������������������������������������������������������������������������� 183
Other (less commonly used) indexers for data access�������������������������������������������������������� 188
Boolean indexing for selecting subsets of data������������������������������������������������������������������� 192
Using the query method to retrieve data����������������������������������������������������������������������������� 192
Operators in Pandas������������������������������������������������������������������������������������������������������������������ 193
Representing dates and times in Pandas��������������������������������������������������������������������������������� 194
Converting strings into Pandas Timestamp objects������������������������������������������������������������ 195
Extracting the components of a Timestamp object������������������������������������������������������������� 196
Grouping and aggregation�������������������������������������������������������������������������������������������������������� 197
Examining the properties of the groupby object����������������������������������������������������������������� 199
Filtering groups������������������������������������������������������������������������������������������������������������������� 201
Transform method and groupby������������������������������������������������������������������������������������������ 202
Apply method and groupby������������������������������������������������������������������������������������������������� 204
How to combine objects in Pandas������������������������������������������������������������������������������������������� 204
Append method for adding rows����������������������������������������������������������������������������������������� 205
Concat function (adding rows or columns from other objects)������������������������������������������� 207
Join method – index to index���������������������������������������������������������������������������������������������� 210
Merge method – SQL type join based on common columns����������������������������������������������� 211

viii
Table of Contents

Restructuring data and dealing with anomalies����������������������������������������������������������������������� 213


Dealing with missing data��������������������������������������������������������������������������������������������������� 214
Data duplication������������������������������������������������������������������������������������������������������������������ 218
Tidy data and techniques for restructuring data����������������������������������������������������������������������� 220
Conversion from wide to long format (tidy data)����������������������������������������������������������������� 221
Stack method (wide-to-long format conversion)���������������������������������������������������������������� 223
Melt method (wide-to-long format conversion)������������������������������������������������������������������ 226
Pivot method (long-to-wide conversion)����������������������������������������������������������������������������� 228
Summary���������������������������������������������������������������������������������������������������������������������������������� 229
Review Exercises���������������������������������������������������������������������������������������������������������������������� 230

Chapter 7: Data Visualization with Python Libraries�������������������������������������������� 243


Technical requirements������������������������������������������������������������������������������������������������������������� 243
External files������������������������������������������������������������������������������������������������������������������������ 244
Commonly used plots���������������������������������������������������������������������������������������������������������������� 245
Matplotlib���������������������������������������������������������������������������������������������������������������������������������� 248
Approach for plotting using Matplotlib�������������������������������������������������������������������������������� 251
Plotting using Pandas��������������������������������������������������������������������������������������������������������������� 253
Scatter plot�������������������������������������������������������������������������������������������������������������������������� 254
Histogram���������������������������������������������������������������������������������������������������������������������������� 255
Pie charts���������������������������������������������������������������������������������������������������������������������������� 256
Seaborn library������������������������������������������������������������������������������������������������������������������������� 257
Box plots������������������������������������������������������������������������������������������������������������������������������ 258
Adding arguments to any Seaborn plotting function����������������������������������������������������������� 259
Kernel density estimate������������������������������������������������������������������������������������������������������� 259
Violin plot����������������������������������������������������������������������������������������������������������������������������� 260
Count plots�������������������������������������������������������������������������������������������������������������������������� 261
Heatmap������������������������������������������������������������������������������������������������������������������������������ 262
Facet grid���������������������������������������������������������������������������������������������������������������������������� 263
Regplot�������������������������������������������������������������������������������������������������������������������������������� 265

ix
Table of Contents

lmplot���������������������������������������������������������������������������������������������������������������������������������� 266
Strip plot������������������������������������������������������������������������������������������������������������������������������ 267
Swarm plot�������������������������������������������������������������������������������������������������������������������������� 268
Catplot��������������������������������������������������������������������������������������������������������������������������������� 269
Pair plot������������������������������������������������������������������������������������������������������������������������������� 270
Joint plot������������������������������������������������������������������������������������������������������������������������������ 272
Summary���������������������������������������������������������������������������������������������������������������������������������� 273
Review Exercises���������������������������������������������������������������������������������������������������������������������� 274

Chapter 8: Data Analysis Case Studies����������������������������������������������������������������� 279


Technical requirements������������������������������������������������������������������������������������������������������������� 279
Methodology����������������������������������������������������������������������������������������������������������������������������� 280
Case study 8-1: Highest grossing movies in France – analyzing unstructured data���������������� 281
Case study 8-2: Use of data analysis for air quality management�������������������������������������������� 288
Case study 8-3: Worldwide COVID-19 cases – an analysis������������������������������������������������������� 308
Summary���������������������������������������������������������������������������������������������������������������������������������� 320
Review Exercises���������������������������������������������������������������������������������������������������������������������� 321

Chapter 9: Statistics and Probability with Python����������������������������������������������� 325


Permutations and combinations����������������������������������������������������������������������������������������������� 325
Probability��������������������������������������������������������������������������������������������������������������������������������� 327
Rules of probability�������������������������������������������������������������������������������������������������������������� 328
Conditional probability��������������������������������������������������������������������������������������������������������� 330
Bayes theorem�������������������������������������������������������������������������������������������������������������������������� 330
Application of Bayes theorem in medical diagnostics��������������������������������������������������������� 331
Another application of Bayes theorem: Email spam classification�������������������������������������� 333
SciPy library������������������������������������������������������������������������������������������������������������������������������ 334
Probability distributions������������������������������������������������������������������������������������������������������������ 335
Binomial distribution����������������������������������������������������������������������������������������������������������� 335
Poisson distribution������������������������������������������������������������������������������������������������������������� 338
Continuous probability distributions������������������������������������������������������������������������������������ 341

x
Table of Contents

Normal distribution�������������������������������������������������������������������������������������������������������������� 341


Standard normal distribution����������������������������������������������������������������������������������������������� 343
Measures of central tendency��������������������������������������������������������������������������������������������������� 347
Measures of dispersion������������������������������������������������������������������������������������������������������������� 348
Measures of shape�������������������������������������������������������������������������������������������������������������������� 349
Sampling����������������������������������������������������������������������������������������������������������������������������������� 353
Probability sampling������������������������������������������������������������������������������������������������������������ 353
Non-probability sampling���������������������������������������������������������������������������������������������������� 354
Central limit theorem���������������������������������������������������������������������������������������������������������������� 355
Estimates and confidence intervals������������������������������������������������������������������������������������ 356
Types of errors in sampling������������������������������������������������������������������������������������������������������� 357
Hypothesis testing�������������������������������������������������������������������������������������������������������������������� 358
Basic concepts in hypothesis testing���������������������������������������������������������������������������������� 358
Key terminology used in hypothesis testing������������������������������������������������������������������������ 359
Steps involved in hypothesis testing����������������������������������������������������������������������������������� 361
One-sample z-test�������������������������������������������������������������������������������������������������������������������� 362
Two-sample sample z-test�������������������������������������������������������������������������������������������������������� 364
Hypothesis tests with proportions�������������������������������������������������������������������������������������������� 366
Two-sample z-test for the population proportions�������������������������������������������������������������� 368
T-distribution����������������������������������������������������������������������������������������������������������������������������� 370
One sample t-test���������������������������������������������������������������������������������������������������������������� 372
Two-sample t-test��������������������������������������������������������������������������������������������������������������� 372
Two-sample t-test for paired samples�������������������������������������������������������������������������������� 373
Solved examples: Conducting t-tests using Scipy functions���������������������������������������������������� 373
ANOVA��������������������������������������������������������������������������������������������������������������������������������������� 376
Chi-square test of association�������������������������������������������������������������������������������������������������� 379
Summary���������������������������������������������������������������������������������������������������������������������������������� 383
Review Exercises���������������������������������������������������������������������������������������������������������������������� 386

Index��������������������������������������������������������������������������������������������������������������������� 393

xi
About the Author
Gayathri Rajagopalan works for a leading Indian
multinational organization, with ten years of experience
in the software and information technology industry.
She has degrees in computer engineering and business
adminstration, and is a certified Project Management
Professional (PMP). Some of her key focus areas include
Python, data analytics, machine learning, statistics, and
deep learning. She is proficient in Python, Java, and C/C++
programming. Her hobbies include reading, music, and
teaching programming and data science to beginners.

xiii
About the Technical Reviewer
Manohar Swamynathan is a data science practitioner
and an avid programmer, with over 14 years of experience
in various data science related areas that include data
warehousing, Business Intelligence (BI), analytical tool
development, ad hoc analysis, predictive modeling, data
science product development, consulting, formulating
strategy, and executing analytics programs. He’s had a
career covering the life cycle of data across different
domains such as US mortgage banking, retail/ecommerce,
insurance, and industrial IoT. He has a bachelor’s degree
with a specialization in physics, mathematics, and
computers, and a master’s degree in project management. He’s currently living in
Bengaluru, the Silicon Valley of India.

xv
Acknowledgments
This book is a culmination of a year-long effort and would not have been possible
without my family’s support. I am indebted to them for their patience, kindness, and
encouragement.

I would also like to thank my readers for investing their time and money in this book. It is
my sincere hope that this book adds value to your learning experience.

xvii
Introduction
I had two main reasons for writing this book. When I first started learning data science,
I could not find a centralized overview of all the important topics on this subject.
A practitioner of data science needs to be proficient in at least one programming
language, learn the various aspects of data preparation and visualization, and also
be conversant with various aspects of statistics. The goal of this book is to provide
a consolidated resource that ties these interconnected disciplines together and
introduces these topics to the learner in a graded manner. Secondly, I wanted to provide
material to help readers appreciate the practical aspects of the seemingly abstract
concepts in data science, and also help them to be able to retain what they have learned.
There is a section on case studies to demonstrate how data analysis skills can be applied
to make informed decisions to solve real-world challenges. One of the highlights of
this book is the inclusion of practice questions and multiple-choice questions to help
readers practice and apply whatever they have learned. Most readers read a book and
then forget what they have read or learned, and the addition of these exercises will help
readers avoid this pitfall.

The book helps readers learn three important topics from scratch – the Python
programming language, data analysis, and statistics. It is a self-contained introduction
for anybody looking to start their journey with data analysis using Python, as it focuses
not just on theory and concepts but on practical applications and retention of concepts.
This book is meant for anybody interested in learning Python and Python-based libraries
like Pandas, Numpy, Scipy, and Matplotlib for descriptive data analysis, visualization,
and statistics. The broad categories of skills that readers learn from this book include
programming skills, analytical skills, and problem-solving skills.

The book is broadly divided into three parts – programming with Python, data analysis
and visualization, and statistics. The first part of the book comprises three chapters. It
starts with an introduction to Python – the syntax, functions, conditional statements,
data types, and different types of containers. Subsequently, we deal with advanced
concepts like regular expressions, handling of files, and solving mathematical problems

xix
Introduction

with Python. Python is covered in detail before moving on to data analysis to ensure that
the readers are comfortable with the programming language before they learn how to
use it for purposes of data analysis.

The second part of the book, comprising five chapters, covers the various aspects of
descriptive data analysis, data wrangling and visualization, and the respective Python
libraries used for each of these. There is an introductory chapter covering basic concepts
and terminology in data analysis, and one chapter each on NumPy (the scientific
computation library), Pandas (the data wrangling library), and the visualization
libraries (Matplotlib and Seaborn). A separate chapter is devoted to case studies to
help readers understand some real-world applications of data analysis. Among these
case studies is one on air pollution, using data drawn from an air quality monitoring
station in New Delhi, which has seen alarming levels of pollution in recent years. This
case study examines the trends and patterns of major air pollutants like sulfur dioxide,
nitrogen dioxide, and particulate matter for five years, and comes up with insights and
recommendations that would help with designing mitigation strategies.

The third section of this book focuses on statistics, elucidating important principles in
statistics that are relevant to data science. The topics covered include probability, Bayes
theorem, permutations and combinations, hypothesis testing (ANOVA, chi-­squared
test, z-test, and t-test), and the use of various functions in the Scipy library to enable
simplification of tedious calculations involved in statistics.

By the end of this book, the reader will be able to confidently write code in Python, use
various Python libraries and functions for analyzing any dataset, and understand basic
statistical concepts and tests. The code is presented in the form of Jupyter notebooks
that can further be adapted and extended. Readers get the opportunity to test their
understanding with a combination of multiple-choice and coding questions. They
also get an idea about how to use the skills and knowledge they have learned to make
evidence-based decisions for solving real-world problems with the help of case studies.

xx
CHAPTER 1

Getting Familiar
with Python
Python is an open source programming language created by a Dutch programmer
named Guido van Rossum. Named after the British comedy group Monty Python,
Python is a high-level, interpreted, open source language and is one of the most sought-
after and rapidly growing programming languages in the world today. It is also the
language of preference for data science and machine learning.

In this chapter, we first introduce the Jupyter notebook – a web application for running
code in Python. We then cover the basic concepts in Python, including data types,
operators, containers, functions, classes and file handling and exception handling, and
standards for writing code and modules.

The code examples for this book have been written using Python version 3.7.3 and
Anaconda version 4.7.10.

T echnical requirements
Anaconda is an open source platform used widely by Python programmers and data
scientists. Installing this platform installs Python, the Jupyter notebook application, and
hundreds of libraries. The following are the steps you need to follow for installing the
Anaconda distribution.

1. Open the following URL: https://www.anaconda.com/products/


individual

2. Click the installer for your operating system, as shown in Figure 1-1.
The installer gets downloaded to your system.

1
© Gayathri Rajagopalan 2021
G. Rajagopalan, A Python Data Analyst’s Toolkit, https://doi.org/10.1007/978-1-4842-6399-0_1
Chapter 1 Getting Familiar with Python

Figure 1-1. Installing Anaconda

3. Open the installer (file downloaded in the previous step) and run it.

4. After the installation is complete, open the Jupyter application


by typing “jupyter notebook” or “jupyter” in the explorer (search
bar) next to the start menu, as shown in Figure 1-2 (shown for
Windows OS).

Figure 1-2. Launching Jupyter

Please follow the following steps for downloading all the data files used in this book:

• Click the following link: https://github.com/DataRepo2019/


Data-files
• Select the green “Code” menu and click on “Download ZIP” from the
dropdown list of this menu
• Extract the files from the downloaded zip folder and import these
files into your Jupyter application

Now that we have installed and launched Jupyter, let us understand how to use this
application in the next section.

Getting started with Jupyter notebooks


Before we discuss the essentials of Jupyter notebooks, let us discuss what an integrated
development environment (or IDE) is. An IDE brings together the various activities
involved in programming, like including writing and editing code, debugging, and
2
Chapter 1 Getting Familiar with Python

creating executables. It also includes features like autocompletion (completing what


the user wants to type, thus enabling the user to focus on logic and problem-solving)
and syntax highlighting (highlighting the various elements and keywords of the
language). There are many IDEs for Python, apart from Jupyter, including Enthought
Canopy, Spyder, PyCharm, and Rodeo. There are several reasons for Jupyter becoming
a ubiquitous, de facto standard in the data science community. These include ease
of use and customization, support for several programming languages, platform
independence, facilitation of access to remote data, and the benefit of combining output,
code, and multimedia under one roof.

JupyterLab is the IDE for Jupyter notebooks. Jupyter notebooks are web applications that
run locally on a user’s machine. They can be used for loading, cleaning, analyzing, and
modeling data. You can add code, equations, images, and markdown text in a Jupyter
notebook. Jupyter notebooks serve the dual purpose of running your code as well as
serving as a platform for presenting and sharing your work with others. Let us look at the
various features of this application.

1. Opening the dashboard

Type “jupyter notebook” in the search bar next to the start menu.
This will open the Jupyter dashboard. The dashboard can be used
to create new notebooks or open an existing one.

2. Creating a new notebook

Create a new Jupyter notebook by selecting New from the upper


right corner of the Jupyter dashboard and then select Python 3
from the drop-down list that appears, as shown in Figure 1-3.

Figure 1-3. Creating a new Jupyter notebook

3. Entering and executing code

Click inside the first cell in your notebook and type a simple line
of code, as shown in Figure 1-4. Execute the code by selecting Run
Cells from the “Cell” menu, or use the shortcut keys Ctrl+Enter.
3
Chapter 1 Getting Familiar with Python

Figure 1-4. Simple code statement in a Jupyter cell

4. Adding markdown text or headings


In the new cell, change the formatting by selecting Markdown
as shown in Figure 1-5, or by pressing the keys Esc+M on your
keyboard. You can also add a heading to your Jupyter notebook by
selecting Heading from the drop-down list shown in the following
or pressing the shortcut keys Esc+(1/2/3/4).

Figure 1-5. Changing the mode to Markdown

5. Renaming a notebook
Click the default name of the notebook and type a new name, as
shown in Figure 1-6.

Figure 1-6. Changing the name of a file

You can also rename a notebook by selecting File ➤ Rename.


6. Saving a notebook
Press Ctrl+S or choose File ➤ Save and Checkpoint.
7. Downloading the notebook
You can email or share your notebook by downloading your
notebook using the option File ➤ Download as ➤ notebook
(.ipynb), as shown in Figure 1-7.
4
Chapter 1 Getting Familiar with Python

Figure 1-7. Downloading a Jupyter notebook

Shortcuts and other features in Jupyter


Let us look at some key features of Jupyter notebooks, including shortcuts, tab
completions, and magic commands.

Table 1-1 gives some of the familiar icons found in Jupyter notebooks, the corresponding
menu functions, and the keyboard shortcuts.

5
Chapter 1 Getting Familiar with Python

Table 1-1. Jupyter Notebook Toolbar Functions


Icon in Toolbar Function Keyboard shortcut Menu function

Saving a Jupyter notebook Esc+s File ➤ Save as

Adding a new cell to a Esc+b (adding a cell below the Insert ➤ Insert Cell
Jupyter notebook current cell), or Esc+a (adding Above or Insert ➤
a cell above the current cell) Insert Cell Below

Cutting a selected cell Esc+x Edit ➤ Cut Cells

Copying the selected cell Esc+c Edit ➤ Copy Cells

Pasting a cell above or Esc+v Edit ➤ Paste Cells


below another selected cell Above or Edit ➤
Paste Cells Below

Running a given cell Ctrl+Enter (to run selected cell); Cell ➤ Run
Shift+Enter (to run selected cell Selected Cells
and insert a new cell)

Interrupting the kernel Esc+ii Kernel ➤ Interrupt

Rebooting the kernel Esc+00 Kernel ➤ Restart

If you are not sure about which keyboard shortcut to use, go to: Help ➤ Keyboard
Shortcuts, as shown in Figure 1-8.

Figure 1-8. Help menu in Jupyter


6
Chapter 1 Getting Familiar with Python

Commonly used keyboard shortcuts include

• Shift+Enter to run the code in the current cell and move to the next
cell.

• Esc to leave a cell.

• Esc+M changes the mode for a cell to “Markdown” mode.

• Esc+Y changes the mode for a cell to “Code”.

T ab Completion
This is a feature that can be used in Jupyter notebooks to help you complete the code
being written. Usage of tab completions can speed up the workflow, reduce bugs, and
quickly complete function names, thus reducing typos and saving you from having to
remember the names of all the modules and functions.

For example, if you want to import the Matplotlib library but don’t remember the
spelling, you could type the first three letters, mat, and press Tab. You would see a drop-
down list, as shown in Figure 1-9. The correct name of the library is the second name in
the drop-down list.

Figure 1-9. Tab completion in Jupyter

Magic commands used in Jupyter


Magic commands are special commands that start with one or more % signs, followed by
a command. The commands that start with one % symbol are applicable for a single line
of code, and those beginning with two % signs are applicable for the entire cell (all lines
of code within a cell).

7
Chapter 1 Getting Familiar with Python

One commonly used magic command, shown in the following, is used to display
Matplotlib graphs inside the notebook. Adding this magic command avoids the need
to call the plt.show function separately for showing graphs (the Matplotlib library is
discussed in detail in Chapter 7).

CODE:

%matplotlib inline

Magic commands, like timeit, can also be used to time the execution of a script, as shown
in the following.

CODE:

%%timeit
for i in range(100000):
    i*i

Output:

16.1 ms ± 283 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)

Now that you understand the basics of using Jupyter notebooks, let us get started with
Python and understand the core aspects of this language.

P
 ython Basics
In this section, we get familiar with the syntax of Python, commenting, conditional
statements, loops, and functions.

Comments, print, and input


In this section, we cover some basics like printing, obtaining input from the user, and
adding comments to help others understand your code.

C
 omments
A comment explains what a line of code does, and is used by programmers to help others
understand the code they have written. In Python, a comment starts with the # symbol.

8
Chapter 1 Getting Familiar with Python

Proper spacing and indentation are critical in Python. While other languages like Java
and C++ use brackets to enclose blocks of code, Python uses an indent of four spaces
to specify code blocks. One needs to take care of indents to avoid errors. Applications
like Jupyter generally take care of indentation and automatically add four spaces at the
beginning of a block of code.

Printing
The print function prints content to the screen or any other output device.

Generally, we pass a combination of strings and variables as arguments to the print


function. Arguments are the values included within the parenthesis of a function, which
the function uses for producing the result. In the following statement, “Hello!” is the
argument to the print function.

CODE:

print("Hello!")

To print multiple lines of code, we use triple quotes at the beginning and end of the
string, for example:

CODE:

print('''Today is a lovely day.


It will be warm and sunny.
It is ideal for hiking.''')

Output:

Today is a lovely day.


It will be warm and sunny.
It is ideal for hiking.

Note that we do not use semicolons in Python to end statements, unlike some other
languages.

The format method can be used in conjunction with the print method for embedding
variables within a string. It uses curly braces as placeholders for variables that are passed
as arguments to the method.

Let us look at a simple example where we print variables using the format method.
9
Chapter 1 Getting Familiar with Python

CODE:

weight=4.5
name="Simi"
print("The weight of {} is {}".format(name,weight))

Output:

The weight of Simi is 4.5

The preceding statement can also be rewritten as follows without the format method:

CODE:

print("The weight of",name,"is","weight")

Note that only the string portion of the print argument is enclosed within quotes. The name
of the variable does not come within quotes. Similarly, if you have any constants in your
print arguments, they also do not come within quotes. In the following example, a Boolean
constant (True), an integer constant (1), and strings are combined in a print statement.

CODE:

print("The integer equivalent of",True,"is",1)

Output:

The integer equivalent of True is 1

The format fields can specify precision for floating-point numbers. Floating-point
numbers are numbers with decimal points, and the number of digits after the decimal
point can be specified using format fields as follows.

CODE:

x=91.234566
print("The value of x upto 3 decimal points is {:.3f}".format(x))

Output:

The value of x upto 3 decimal points is 91.235

We can specify the position of the variables passed to the method. In this example, we
use position “1” to refer to the second object in the argument list, and position “0” to
specify the first object in the argument list.
10
Chapter 1 Getting Familiar with Python

CODE:

y='Jack'
x='Jill'
print("{1} and {0} went up the hill to fetch a pail of water".format(x,y))

Output:

Jack and Jill went up the hill to fetch a pail of water

I nput
The input function accepts inputs from the user. The input provided by the user is stored
as a variable of type String. If you want to do any mathematical calculations with any
numeric input, you need to change the data type of the input to int or float, as follows.

CODE:

age=input("Enter your age:")


print("In 2010, you were",int(age)-10,"years old")

Output:

Enter your age:76


In 2010, you were 66 years old

Further reading on Input/Output in Python: https://docs.python.org/3/tutorial/


inputoutput.html

V
 ariables and Constants
A constant or a literal is a value that does not change, while a variable contains a value
can be changed. We do not have to declare a variable in Python, that is, specify its data
type, unlike other languages like Java and C/C++. We define it by giving the variable a
name and assigning it a value. Based on the value, a data type is automatically assigned
to it. Values are stored in variables using the assignment operator (=). The rules for
naming a variable in Python are as follows:
• a variable name cannot have spaces

• a variable cannot start with a number

11
Chapter 1 Getting Familiar with Python

• a variable name can contain only letters, numbers, and underscore


signs (_)

• a variable cannot take the name of a reserved keyword (for example,


words like class, continue, break, print, etc., which are predefined
terms in the Python language, have special meanings, and are invalid
as variable names)

Operators
The following are some commonly used operators in Python.

Arithmetic operators: Take two integer or float values, perform an operation, and return
a value.

The following arithmetic operators are supported in Python:

• **(Exponent)

• %(modulo or remainder),

• //(quotient),

• *(multiplication)

• -(subtraction)

• +(addition)

The order of operations is essential. Parenthesis takes precedence over exponents,


which takes precedence over division and multiplication, which takes precedence
over addition and subtraction. An acronym was designed - P.E.D.M.A.S.(Please Excuse
My Dear Aunt Sally) - that can be used to remember the order of these operations to
understand which operator first needs to be applied in an arithmetic expression. An
example is given in the following:

CODE:

(1+9)/2-3

Output:

2.0

12
Chapter 1 Getting Familiar with Python

In the preceding expression, the operation inside the parenthesis is performed first,
which gives 10, followed by division, which gives 5, and then subtraction, which gives the
final output as 2.

Comparison operators: These operators compare two values and evaluate to a true or
false value. The following comparison operators are supported in Python:
• >: Greater than
• < : Less than
• <=: Less than or equal to
• >=: Greater than or equal to
• == : equality. Please note that this is different from the assignment
operator (=)
• !=(not equal to)

Logical (or Boolean) operators: Are similar to comparison operators in that they
also evaluate to a true or false value. These operators operate on Boolean variables or
expressions. The following logical operators are supported in Python:

• and operator: An expression in which this operator is used evaluates


to True only if all its subexpressions are True. Otherwise, if any of
them is False, the expression evaluates to False
An example of the usage of the and operator is shown in the following.
CODE:

(2>1) and (1>3)

Output:

False

• or operator: An expression in which the or operator is used, evaluates


to True if any one of the subexpressions within the expression is True.
The expression evaluates to False if all its subexpressions evaluate to
False.
An example of the usage of the or operator is shown in the following.

CODE:

(2>1) or (1>3)
13
Another Random Scribd Document
with Unrelated Content
— Je ne peux m’empêcher, en effet, reprit Gaspard, de trouver
bien sots les princes de la terre, les puissants du monde, qui
s’imaginent que le peuple ne pense pas, parce qu’il est muet. Le
peuple a l’air de ne point penser, parce qu’il ne sait pas s’exprimer
avec des mots savants, des mots de livres, mais sa pensée s’agite
dans son cœur ; — et quand il la reconnaît dans la parole des
grands hommes, il comprend qu’elle est juste et il sent se délier sa
langue… Or çà, je vois que l’ami Pablo donne des signes
d’impatience. N’oublions pas qu’il a un miracle à nous conter et qu’il
brûle de faire briller son éloquence à nos yeux.
CHAPITRE X

Pablo raconte un miracle qu’il a lui-même accompli ; et Bernard pense à


Thérèse.

— La vue de mauvais chrétiens hypocrites, dit Pablo, m’a fait


perdre tout respect pour ma religion ; mais, après avoir entendu les
choses neuves et admirables que notre capitaine vient de nous lire,
mes bouffonneries vous paraîtraient fades. J’aime mieux me taire,
car je dois reconnaître que ces belles pensées dont vous parlez
n’auraient pas été écrites, si notre religion ne les avait pas
engendrées.
— Pablo, dit Gaspard, vous pouvez rire et nous égayer. Le rire
est sain et les critiques sont utiles. Quelque facétieux que puisse
être le récit que vous allez faire, il ne nous empêchera pas d’être de
vrais chrétiens à notre façon, c’est-à-dire religieusement amis des
cœurs charitables et justes. Notre religion, quand on la professe
sans hypocrisie, est la plus respectable du monde. Ce n’est pas
avec des simagrées qu’on gagne le ciel, c’est avec de la
bienfaisance…
— Il est vrai que les pharisiens sont les seuls à ne jamais rire, dit
Pablo. Eh bien, donc, voici mon miracle, un miracle, je le répète, que
j’ai fait moi-même, par ma propre volonté, sans être saint ni même
bienheureux… Lorsque je résolus de m’établir ermite, pour vivre
grassement sans rien faire qu’exploiter la crédulité des ignorants, je
pensai d’abord à me loger au sommet des montagnes Maures,
auprès de la chapelle dédiée à Notre-Dame des Anges. Vous savez
qu’elle reçoit fréquentes visites de pèlerins, et je comptais sur eux
pour avoir à ma suffisance de quoi manger et boire.
Malheureusement, un autre fainéant m’avait prévenu ; la place était
prise ; et cet ermite, mon rival, était, comme moi, jeune et fort ; il n’y
avait pas apparence qu’il me devançât en paradis pour me laisser
exercer seul ici-bas sa profession parfois lucrative. Je m’installai
néanmoins dans la plaine, au bas de la colline dont il habitait le haut
plateau, aux abords de Gonfaron, un pays fameux par sa façon de
rire des ânes et des âneries. De là, je surveillais l’ermite dont j’étais
jaloux, et dont la réputation était grande dans le pays. Au moins,
pensais-je, j’apprendrai, en le surveillant avec attention, par quels
moyens il arrive à gagner la faveur populaire. Je sus bientôt que,
depuis l’arrivée de cet ermite, la statue de Notre-Dame-des-Anges
affirmait par un miracle singulier la sainteté du gredin. Cette statue
de bois sculpté versait parfois des larmes, de véritables larmes, sur
la misère ou la douleur des suppliants, — ce qui équivalait à leur
promettre sa pitié et par suite son intercession auprès de son fils. —
« Mon frère, dis-je à l’ermite, comment t’y prends-tu pour obtenir ce
miracle ingénieux ?… Que fais-tu de mal à la sainte Vierge pour la
faire pleurer, pechère ? » Obstinément, il se refusa à répondre, se
contentant de hocher la tête : « Dieu est si grand ! » murmurait-il.
Cependant nous avions quelque amitié l’un pour l’autre ; et tantôt il
descendait me voir dans ma plaine, et tantôt je montais le voir sur sa
colline.
Un soir d’été, assez tard, il me quitta, après quelques pieuses
libations faites en commun, et il se trouva que ce fut par une pluie
torrentielle. « Couchez ici », lui avais-je dit. Pour une raison
quelconque, il n’y consentit point, et partit sur sa bonne mule. (Il
avait une mule, l’heureux coquin !) Or, la pluie battante et bruyante
ne discontinua pas de toute la nuit, accompagnée de tonnerres
ininterrompus. Ne pouvant dormir, j’employai mon insomnie à
chercher un stratagème pour obtenir la révélation du secret de mon
confrère. Et voici ce que j’imaginai. N’ayant point de mule ni même
d’âne, en ce temps-là, je partis à pied, une heure avant le jour, pour
rejoindre là-haut l’homme au miracle.
« — Attends un peu, pensais-je, je vais t’en servir un de ma
façon ! » — Grâce à celui que je lui préparais, je comptais l’étonner à
mon tour, et me faire considérer décidément comme un rival
redoutable…
— Que comptiez-vous faire ?
— Je prétendais tout simplement cheminer à pied, dans la nuit,
— sous la pluie qui tombait en déluge, — et arriver chez mon
confrère sans avoir mouillé un fil de mes vêtements ! C’était vouloir
accomplir un miracle et des plus difficiles ! — Je le fis. J’avais à
marcher une bonne lieue par des sentiers montants et rocailleux,
sous le grand ciel ruisselant et sous des rafales terribles qui
m’envoyaient au visage de véritables trombes d’eau.
« Et mon miracle s’accomplit, vous dis-je, puisque j’arrivai,
comme je l’avais voulu, à Notre-Dame, au seuil de la chapelle, sans
que ma robe eût reçu seulement une gouttelette de l’eau du ciel…
Voilà comment je fis, tel que vous me voyez, un miracle, et point
niable.
— Et le mot de l’énigme ? dit Sanplan, car je conviens qu’il est
impossible à un sacripant tel que toi d’obtenir, de Dieu ou des
Saints, l’ombre de l’ombre d’un pareil prodige !
— Le mot de l’énigme, c’est, dit Pablo, que j’avais voyagé tout
nu.
Un éclat de rire accueillit cette explication incomplète.
— Il faisait nuit, remarqua Sanplan, par bonheur pour les
passantes.
— De passantes, je n’en rencontrai point… La pluie tombait drue
et me lavait du col jusqu’aux pieds.
— Une fois n’est pas coutume, ami Pablo, mais tes sandales
étaient mouillées ?… et tes cheveux aussi ? Et puis, il te fallait
paraître habillé de vêtements bien secs devant ton collègue ?
— J’avais abrité ma tête sous un large morceau d’écorce, creux,
arraché à une énorme verrue de suve (chêne-liège), une de ces
rusques dont nos liégeurs font des baquets. J’avais mis, au fond de
ce bouclier vaste et profond, ma robe bien pliée, serrée et bien au
sec, et aussi mes sandales. Arrivé au seuil de la chapelle, je jetai ma
rusque au loin… Je m’arrêtai sous l’arcade d’entrée pour enfiler ma
robe ; je mis mes sandales ; et aussitôt, je tirai la corde de la cloche.
L’ermite accourut. Et alors un autre grand miracle se produisit ; je n’y
fus pour rien : juste à ce moment, sous ses yeux, la pluie torrentielle
brusquement cessa.
« — Il m’a été miraculeusement permis, par Notre Dame, lui dis-
je, de te rejoindre sous ce déluge sans être mouillé, afin de te bien
prouver que je suis digne d’apprendre le secret de ton faux
miracle. »
« Il crut au mien et, se jetant à mes pieds : « Hélas ! s’écria-t-il, je
confesse mon imposture ! » Il me montra alors que, par un petit trou
bien caché dans la muraille de la chapelle, derrière la statue de
Notre-Dame, il avait fait entrer les fines extrémités d’une verte tige
de vigne ; chacune de ces extrémités, par de fins pertuis
correspondants, pénétrait dans la tête jusqu’au coin des yeux de la
statue de bois qui, au printemps, pleurait, tout naturellement, de
petites larmes miraculeuses !
— Et vous prîtes la place de ce brave homme ? demanda
sévèrement Sanplan.
— Vous ne me connaissez pas encore ! dit Pablo avec une
certaine tristesse… mais je l’ai mérité ! — Non, je ne pris pas la
place de l’homme ingénu que j’avais trompé. — « Écoute, lui dis-je,
ta simplicité sera respectée. J’aurais voulu croire à ton miracle. Je
regrette d’avoir été déçu ; mais que tu aies pu voir par tes yeux que
le mien du moins est véritable, cela me console… » Alleluia, mes
amis ! Il existe, ô miracle ! des hommes rusés qui sont en même
temps des naïfs ! Il y a des athées qui sont des gobeurs ! il y a des
imposteurs qui ont de la sincérité !… Il y a de faux prophètes qui
croient aux sorciers !… — « Va, dis-je à l’ermite imposteur, va, mon
frère, et ne pèche plus ; et vis en paix. J’aurais honte et remords de
troubler ton innocence prodigieuse !… Par ta candeur parfaite, je te
trouve non seulement digne de respect, mais digne aussi d’exploiter
la sottise des bonnes gens qui croient à ton pouvoir bienfaisant ! Ne
les détrompe donc pas, et que leur erreur consolante soit désormais
la récompense de ton aveu sincère et de ta contrition ! » Ce disant,
je le laissai à genoux, priant Dieu et invoquant mon saint nom, à moi,
pauvre pécheur ! Pour lui, je suis resté un saint, et cela vaut mieux
que bien des gloires plus mal acquises.
— Après celle-là, s’écria Sanplan émerveillé, il faut tirer
l’échelle… Vous avez, frère Pablo, le génie le plus génial qui ait
jamais étonné mon infime génie… et je baiserais le bas de votre
robe… si vous la décrottiez plus souvent.
— Ma foi, conclut Gaspard, l’histoire est édifiante et le conteur
n’est pas trop méchant ;… mais est-ce que notre mélancolique
Bernard ne nous conte rien, à son tour ?
— Excusez-moi, maître, dit Bernard ; ma jeunesse gagne plus à
écouter vos sagesses qu’à entrer avec elles en rivalité d’éloquence.
— J’entends, j’entends, dit Gaspard avec un bon sourire ; tu as
une pensée unique, que je connais bien, bel amoureux, et tu
préfères ne pas t’en distraire… A ton aise ! Tu n’as peut-être pas tort.
— Alors, à toi, Sanplan ! conte-nous une histoire.
— Ceci, dit Sanplan, n’est pas un conte à plaisir inventé ; c’est
bel et bien une aventure à laquelle j’ai pris une part glorieuse, au
temps de ma belle jeunesse.
« … J’étais matelot à bord du Saint-Magloire, un beau brick
marseillais, et nous faisions route pour la Guadeloupe. Nous étions
une centaine de marins, à bord, sous les ordres d’un fameux
capitaine, mes amis ! un homme qui jamais n’eut peur de rien.
« Et voilà que, tout en un coup, nous rencontrâmes un Anglais,
un bateau magnifique, qui s’en allait à la Jamaïque… Comme il
aurait pu tenter les pirates de Tunis ou d’Alger, nous ne voulûmes
pas en laisser l’aubaine à ces païens, et nous l’attaquâmes nous-
mêmes pour la gloire et le profit de la chrétienté. La capture était
bonne. Son chargement — une fortune ! — fut transporté, en un clin
d’œil, sur notre brick, avec tout son équipage et avec tous ses
passagers ; les passagers, c’était une vingtaine de beaux messieurs
d’Angleterre, et une bonne douzaine de belles dames anglaises. Ces
dames étaient des personnes diablement riches, à en juger par le
nombre de coffres, — emplis de falbalas, chapeaux et robes, — dont
elles se firent suivre à notre bord.
« Vingt-cinq de nos matelots furent chargés de conduire en port
sûr le bâtiment anglais, notre capture ; et nous, nous reprîmes notre
route.
« Mais voilà que, le lendemain, survient encore un Anglais, un
brick de guerre, celui-là ! et qui nous donne la chasse !
« Attention ! dit notre capitaine, attention ! les enfants ! nous
allons rire ! » Et il nous ordonna d’ouvrir les coffres de nos belles
captives, d’y prendre leurs atours, robes, mantelets, chapeaux à
plumes, ajustements de toute sorte, — falbalas, soie et dentelles, —
et de nous déguiser en femmes de qualité… Nous avions compris ! il
voulait faire croire au bateau de guerre anglais que nous étions
d’inoffensives demoiselles qui se promenaient en mer, allant d’une
île à l’autre, rendre des visites…
« Tous les passagers furent enfermés dans l’entrepont, tandis
que, sur le pont, nous autres, les matelots en jupons, pouffant de rire
et cachant, sous les ombrelles et les chapeaux à plumes, nos
visages dont quelques-uns étaient admirablement barbus, nous
nous pavanions, en gangassant la poupe ou la croupe, comme font
toutes les dames qui sont vraiment de qualité.
« Donc, le capitaine comptait que, nous prenant pour de chastes
Anglaises, l’Anglais nous laisserait passer… Pas du tout !… Il nous
envoie un coup de canon pour appeler notre attention ; puis, il nous
arraisonne ; — autrement dit, il nous demande qui nous sommes…
« J’empoigne un porte-voix, sur un signe de mon chef, et je crie à
l’ennemi, en anglais de la Canebière :
« Ta maïré a fach ùn pouarc ! » L’Anglais, sans doute, ne
reconnut pas sa langue maternelle, puisqu’il s’apprêta à nous
canonner de nouveau ; et, cette fois, tout de bon.
« Comme nous n’étions pas taillés pour lui échapper par la fuite,
le capitaine nous cria : « En êtes-vous pour l’abordage ? » — Avec
ensemble, nous répondîmes : « Oui ! oui ! à l’abordage ! » Notre brick
aussitôt vire de bord, court sur l’Anglais, l’aborde de flanc… et nous
voilà, enjuponnés comme nous étions, jetant au diable ombrelles et
chapeaux de femmes pour empoigner pistolets et haches,
retroussant nos cotillons pour sauter sur le pont de l’ennemi ! C’était
magnifique, toutes ces fausses femmes, mentons barbus, crânes
tondus, poussant le cri de guerre et s’agitant dans leur soie et leurs
dentelles déchirées ; on aurait dit des pavillons vivants, de toutes les
couleurs ! L’Anglais perdit du temps à s’étonner, et nous en
profitâmes pour l’étonner davantage par la rapidité de nos
mouvements. Cogne à droite, cogne à gauche ! On bondissait en
avant, en arrière, pour attaquer, pour éviter… saute à bâbord, saute
à tribord… Chassez, croisez !… Ce fut un bal, mes enfants, un bal
enragé : pavane et courante, trin-coquin, roumavagi du diable, une
fête de Turc à More ! zou ! zou ! én éleis ! un branle-bas si inattendu,
si extraordinaire, vu nos habillements, que l’Anglais, avant d’être
revenu de sa surprise, dut se rendre, dès qu’il eut vu l’un de nous —
et c’était moi-même ! — amener bravement son pavillon ! C’était moi-
même, mes enfants, moi, Sanplan, qui avais l’air, enjuponné comme
j’étais, de la déesse des combats maritimes !
« Quand nous arrivâmes à la Pointe-à-Pitre avec notre prise,
comme nous avions, par plaisanterie, gardé nos drôles
d’accoutrements, nous fûmes reçus avec des honneurs doubles,
ceux qu’on doit à des amiraux vainqueurs, — et ceux qu’on doit au
beau sexe. Et cette journée sera fameuse dans l’histoire, sous le
nom de journée des miss [7] . »
[7] Authentique.

Lorsque Sanplan se tut, au milieu des rires :


— Es-tu bien sûr, dit Gaspard, d’avoir été l’un des héros de cette
histoire ?… Je crois qu’elle se passa dans un temps où tu tétais
encore… Mon grand-père me l’a contée bien souvent.
— Ma foi, répliqua Sanplan, il me semble bien que mes souvenirs
ne me trompent pas et que j’étais de l’aventure… Au surplus, quand
une histoire vous amuse, c’est folie de chercher à gâter votre plaisir
avec des comment, des quand et des pourquoi… Il y aura toujours
assez de critiques…
CHAPITRE XI

L’oie de frère Anselme.

Quand on eut applaudi Sanplan, au milieu des rires :


— Convenez, dit tout à coup Lecor à Pablo, que vous m’avez
gardé je ne sais quelle antipathie depuis le jour de mon admission
dans la bande. Ce jour-là même, je contai, sur la demande du
capitaine, le Siège de Six-Fours ; et ce récit fut accueilli par un tel
succès de gaîté que vous-même vous en rîtes, mais d’un rire qui
tirait sur le jaune.
Dom Pablo fit une grimace.
— Les passions du monde civilisé, dit-il, visitent les ermites
jusqu’au fond des déserts, et je dois convenir que, malgré mes
sentiments religieux, je vis en vous un rival dangereux pour ma
gloire terrestre ; je tremblai pour la préséance de mon éloquence
sacrée, mais cette impression ne dura pas.
— Je crois, dit Lecor, qu’elle s’effaça le jour de la Fête-Dieu, à
Saint-Maximin. Là, votre triomphe dépassa le mien de cent coudées,
attendu que je n’avais, moi, conté le Siège de Six-Fours qu’à nos
camarades, tandis que, ce jour-là, votre discours s’adressait à tout
un peuple. Vous l’enthousiasmâtes… Il vous le fit bien voir, lorsqu’il
vous hissa sur le dos d’un âne plus fleuri et enrubanné qu’un mât de
Cocagne dressé pour la Sant-Aroï.
— C’est ce jour-là, dit Pablo, que vous prononçâtes ces paroles
serviables que je n’oublierai jamais : « Ton exorde est bon, soigne ta
péroraison ».
— Et vous la soignâtes, en orateur expérimenté, ô Pablo, lorsqu’il
advint qu’un âne, ayant braillé à tue-tête, pour vous applaudir sans
doute, vous profitâtes de l’incident et braillâtes vous-même en toute
hâte, comme si le braiement eût été votre façon naturelle de vous
exprimer. Vous régalâtes ainsi l’assemblée des Trois-États ; et moi-
même, vous m’enchantâtes.
— Vous êtes, ami Lecor, une bonne pâte.
— Ami Pablo, je m’en flatte.
— Mais, avec tout cela, dit Gaspard, riant, Pablo ne saurait se
vanter d’avoir pris sur toi, Lecor, sa revanche du Siège de Six-
Fours ; car, à bien juger, il dut son succès de Saint-Maximin à l’art de
l’orateur et non à l’art du narrateur ; et ce sont deux genres très
différents. Les récits qu’il nous a faits aujourd’hui ne sont pas, à
proprement parler, des contes, mais plutôt des fragments de
mémoires personnels. Et lorsqu’il a voulu, le soir même de son
arrivée parmi nous, nous amuser par le récit qu’il intitula : la Pluie de
macaronis, il a pu voir que, en bons juges, nos hommes lui firent
froid accueil. Je demande, en conséquence, qu’il nous régale
aujourd’hui d’une histoire digne de faire pendant au Siège de Six-
Fours… Point d’excuse, Pablo ! Qu’on réunisse la bande !
— Et surtout, dit Pablo, que personne n’ait plus la cruauté de
faire allusion à ces misérables macaronis. Je vais vous dire une
vraie histoire de moine, friande à se lécher les doigts. Cette histoire
se rattache à notre conversation de tout à l’heure sur la férocité et
l’absurdité des guerres de religion, car le baron des Adrets en est le
héros. Ce beau sire, dont les bandes avaient failli s’emparer de notre
ville d’Avignon, s’était fait protestant. C’est lui qui força, un jour,
quelques-uns de ses vaincus catholiques à sauter du haut d’une tour
pour s’abîmer contre terre. Cependant, un bon mot suffisait parfois à
désarmer ce bandit, auquel nul de nous ne voudrait ressembler.
« Combien cet homme fut méchant jusqu’à la férocité, l’histoire
que je vais vous conter le montrera. Elle fait voir aussi comment, de
tout temps, l’esprit gaulois sait se venger des plus atroces violences,
et quelquefois y échapper, grâce à la vertu du rire. Il n’y a pas de
géant qui ne soit tôt ou tard vaincu par la spirituelle malice d’un
nain…

Sanplan prit son sifflet de maître d’équipage ; et, quand, à son


appel, les hommes furent tous réunis, Pablo commença ainsi :
— C’était en un temps, pas très éloigné du nôtre, où de féroces
barons terrorisaient leurs vassaux, et où un rustre ne pouvait pas
prendre au lacet un lapin sauvage sans courir le risque d’être pendu.
« Entre les plus affreux de ces barons-bandits, qui, embusqués
dans leurs châteaux forts, juchés au sommet des collines, étaient
toujours prêts à fondre comme des faucons sur les pauvres
braconniers — le baron des Adrets était le plus cruel. La chasse était
sa seule passion ; ses vengeances les plus atroces s’exerçaient
contre les piégeurs. Prendre un cerf sur ses terres, ou seulement un
lièvre, c’était se livrer soi-même à la mort et préalablement à la
torture ; car jamais un malheureux, condamné à la pendaison par
son bon plaisir, n’eut le bonheur d’une mort simple. Il le faisait
fouetter d’abord, cribler de coups d’aiguille ; brûler au fer rouge ; et il
trouvait, aux cris de douleur des ses victimes, un âcre plaisir de
diable à face humaine.
— Le conte promet, chuchota Sanplan.
— Or, sur les terres du baron, se trouvait un couvent ; et, dans ce
couvent, un religieux qui avait, lui aussi, la passion de la chasse,
exagérée par le vice de gourmandise. C’était le frère Anselme, qui
avait été diable avant de se faire ermite ; et il braconnait à cœur-joie.
S’il parvenait, en hiver, quand, sous la neige, la terre est gelée, à
capturer un daim qui, attiré par une poignée de foin placée au bon
endroit, tombait dans quelque piège savant, — fosse creusée, par
exemple, et recouverte de branchettes et de feuillages, — alors le
monastère s’en régalait, en buvant à la mort subite du farouche
seigneur qu’on vouait de tout cœur à la colère céleste.
« Plusieurs fois, notre malheureux moine avait été pris et
bâtonné.
— Bâtonner un homme d’Église, dit Sanplan, cela ne se faisait
guère, à ce que je me suis laissé conter. Les plus terribles de ces
barons reculaient devant la robe des religieux.
— Vous oubliez que le farouche sire des Adrets s’était converti
au protestantisme. Cependant, il se souvenait d’avoir été catholique ;
et, par dérision, il prenait soin de faire dépouiller d’abord Anselme de
sa robe lorsqu’il le voulait punir. Cette robe respectable, il la faisait
poser devant lui sur un buisson, la saluait comme dévotement,
assurant que oncques il ne porterait la main sur elle ; cela, disait-il,
pour deux raisons : la première, c’est qu’elle était pleine de vermine ;
la seconde, c’est qu’elle était sainte et vénérable. Puis il se tournait
vers le moine tout nu et lui disait : « Maintenant que tu n’es plus
qu’un homme comme un autre, et pour ce que tu as touché au gibier
défendu, je te vais faire châtier au nom de Dieu, comme fut châtié
Adam, notre père à tous, pour avoir touché au fruit défendu. »
« Et, à plusieurs reprises, le frère Anselme avait été fouetté
jusqu’au sang ; mais le bougre frottait ses plaies avec un certain
onguent dont il avait la recette, et reprenait bien vite, au couvent, ses
patenôtres et, dans les bois, ses habitudes de maraudeur.
« Un beau jour, comme l’aimable seigneur allait se mettre à table,
on accourut lui annoncer que le frère Anselme venait d’être capturé,
dans le moment où il ramassait, à l’orée du bois voisin, une couple
de belles perdrix.
« Le baron était déjà assis, plein d’appétit, devant sa large table
chargée de flacons ; et on lui présentait une oie sauvage cuite à
point et dorée à souhait, dont, par avance, il se pourléchait les
babouines…
« — Amenez-moi ce coquin, cria-t-il à ses gens.
« On le lui amena. Deux valets le tenaient entre leurs griffes et le
secouaient rudement par la gorge.
« — Qu’en faut-il faire, beau seigneur ?
« Déjà ivre à demi pour avoir bu force rasades d’un vin
comparable au vin merveilleux qu’on nomme, en Avignon,
Châteauneuf-des-Papes, ou à celui qui, à Toulon, est célèbre sous le
nom de Lamalgue, le baron était, par hasard, de bonne humeur.
Lorsqu’il était de bonne humeur, il était pire, car alors il se voulait
amuser, et ses amusements étaient d’un fou et dix fois plus cruels
qu’à l’ordinaire.
« Voyant frère Anselme trembler de tous ses membres, il voulut
jouer de lui, comme chat avec souris, avant de lui faire endurer le
dernier supplice.
« En sorte qu’une idée de joyeux dément lui passa par la tête.
« — La dernière fois que je t’ai puni, lui dit-il, je t’ai promis qu’à la
prochaine tu serais enfin pendu — et tout nu, comme de juste, car je
respecte ta robe. Aujourd’hui, je change d’idée. Tu n’y perdras rien ;
au contraire…
« Le baron, jouissant de voir l’anxiété de sa victime, garda le
silence un instant, puis tout à coup : « Je t’invite à souper avec
moi ! »
« Frère Anselme, tremblant, se demandait quel piège pouvait
bien cacher une politesse si peu attendue.
« Le baron répéta :
« — Je t’invite à dîner avec moi ; et, comme cela n’est pas un
supplice, je te laisse, pour l’instant, ta robe, vu que ta peau me serait
encore plus déplaisante à voir que cette robe dégoûtante. Allons,
assieds-toi, coquin !
« Frère Anselme ne savait que penser. Il était payé pour savoir
qu’on doit toujours se méfier des puissants qui s’amusent ; et que,
comme l’a écrit l’empereur Marc-Aurèle, rien, rien n’est plus horrible
que les caresses d’un loup.
« Toutefois, espérant qu’en sa bonne tête de casuiste il trouverait
peut-être un moyen de se tirer d’affaire sans trop de mal, il se
rassura quelque peu, feignit de croire à la clémence du monstre ; et,
par un effort de volonté, cessant de trembler, il se mit à table, et dit :
« — Mon cher seigneur est trop bon. Que la paix du ciel soit
avec lui !
« Un écuyer tranchant, aiguisant un grand coutelas, s’apprêtait à
le plonger dans les chairs, visiblement succulentes, de l’oie.
« Le baron arrêta d’un signe son officier de bouche.
« — Pour aujourd’hui, dit-il à Anselme, mon écuyer tranchant, ce
sera toi. Qui si bien tue gibier courant, doit magnifiquement
découper gibier mort… Qu’on pose devant le moine cette oie si
appétissante qu’elle a l’air de dire « Mange-moi ; » et qu’on lui mette
en main les tranchoirs dont il va jouer en maître ;… mais, avant tout,
pour lui donner bon courage à sa difficile besogne, qu’on emplisse
de vin ma plus large coupe… Bien… Bois-la d’un trait, mon frère, à
ma santé.
« Le moine but, et se sentit tout de suite le cœur plein
d’espérance. Il commençait à croire qu’il était à demi pardonné… Le
dieu qui est dans le vin entra dans son cœur ; un bon sourire parut
sur ses lèvres ; il dit le benedicite d’un air reconnaissant.
« L’affreux baron riait de bon cœur. Le moine regardait l’oie
attentivement, la tournant et retournant ; cherchait à bien reconnaître
les jointures où il comptait introduire sans tâtonner les deux
tranchoirs, qu’il élevait déjà, un dans chaque main :
« — Un moment encore, mon frère, s’écria le baron cruel ; je ne
veux point te prendre en traître. J’oubliais de t’annoncer la punition
qui t’attend. Il est vrai que l’oie une fois découpée par tes mains
adroites, je jure que tu en auras ta part. Mais sache bien qu’ensuite,
on te fera, à toi, exactement tout ce qu’à elle tu auras fait.
« — Qu’entendez-vous par là, mon bon seigneur ?
« — J’entends que si tu lui coupes une aile, on te retranchera un
bras ; si une cuisse, on te retranchera une jambe. Prends garde, te
dis-je, que tout ce que tu feras à cette oie, on te le fera ensuite, et
dans l’ordre que tu auras choisi. C’est pourquoi je te conseille
d’abréger toi-même ton supplice, en commençant par lui couper la
tête.
« Le baron riait en buvant ; et, lâchement, les valets riaient aussi,
sachant que le seigneur, passé maître en cruautés joyeuses, ferait
comme il promettait. Par avance, ils jouissaient du spectacle d’un
moine découpé tout cru comme une oie rôtie.
« Le moine, n’eût été qu’il avait bu, aurait pâli ; mais, soutenu par
la vertu du vin :
« — Je conviens, dit-il, que jamais il ne fallut à un homme, pour
découper une oie, courage pareil à celui que vous me contraignez
d’avoir. Et donc, monseigneur, j’affirme qu’une seconde coupe de
vin, pour me renforcir le cœur, me serait d’un grand secours, et
servirait par là vos louables intentions.
« — Versez-lui une seconde coupe. J’aime la vaillantise ; le
gredin en montre véritablement. Qui bien boit, pisse bien, jarnidieu !
Et qui pisse bien, bien se battra. Allons, maintenant, attaque ton
ennemi, bon moine ! Car cette oie est ta seule et véritable ennemie,
puisqu’elle déterminera ton genre de supplice.
« — Je ne sais, dit Pablo, si, sans avoir bu plus que de raison,
une autre créature, moine ou homme d’armes, eût fait aussi bonne
contenance que frère Anselme en présence d’une oie aussi
dangereuse, quoique morte.
« Il avait posé sur la table un de ses deux tranchoirs ; et, de sa
main libre, il se grattait la tête comme un homme embarrassé ; et, à
parler franc, il y avait de quoi se gratter la tête, même si elle était
pure de toute vermine.
« Il se grattait pour ranimer les esprits animaux qui, sous son
crâne, étaient effrayés par les conséquences fatales du geste qu’il
allait faire. Tout à coup des éclairs riants pétillèrent dans ses yeux : il
venait de concevoir une idée merveilleuse qui lui fut inspirée par le
ciel ou par le diable, — c’est au choix des complexions de chacun…
« Toute sa figure, peu à peu, se mit à rayonner de facétieuse
malice… Il préparait une galégeade héroïque, homérique… Il leva
sur le tyran, puis sur l’assistance, ses yeux pleins de rire, puis les
abaissa sur l’oie redoutable. Sa main gauche se débarrassa, sur la
table, du second tranchoir ; puis, de cette main gauche, il saisit l’oie
et la maintint solidement contre le vaste plat d’argent. Ensuite, avec
ostentation, il tendit et roidit l’index de sa main droite, — lequel index
lentement il enfonça, énergique et rigide, dans le trou que notre oie
avait eu jadis sous la queue ; puis, retirant du trou ce doigt, tout
gluant de bonne graisse, il le promena sur ses lèvres et le pourlécha
d’un air satisfait… »
Lorsqu’avec son chef et toute la bande, Sanplan eut ri
copieusement :
— Je n’ai, sire Pablo, qu’un mot à reprendre dans votre récit ;
vous avez dit : « le trou qu’elle avait eu jadis sous la queue. » Ne
l’avait-elle donc plus, ce trou ? Je croyais qu’il nous accompagnait
fidèlement dans la tombe.
— Messire Sanplan, répliqua Pablo, elle l’avait toujours, mais non
plus sous la queue, — la queue étant de plumes, et l’oie rôtie étant
oie plumée ; mais permettez que je continue :

« Voyant l’audace et l’insolence de ce geste, les valets, par


bonheur, attendirent que le maître eût parlé, pour régler leurs mines
sur la sienne.
« Et Anselme, tenant bien haut son index reluisant, et arrêtant sur
son féroce seigneur un regard ferme, lui dit :
« — En champ clos et devant tout un peuple, ou en lieu
particulier et secret, seigneur baron, je vous défie bien de m’en faire
autant.
« Or, le rire est une puissance de la nature qu’on ne peut toujours
maîtriser, à toute heure et partout. Le baron fut vaincu par cette
puissance qui jadis, aux temps de Jupiter, triomphait parfois de tout
l’Olympe rassemblé : le baron des Adrets éclata de rire. Ses valets
ne résistèrent pas davantage à cette force naturelle qui veut qu’on
rie sans mesure ; et la salle retentit d’une gaieté formidable, qui
secoua, durant un long moment, les ventres et les têtes, comme un
coup de mistral secoue les pignatèous.
« Enfin, le baron, qui étouffait de rire, put reprendre haleine et
parler :
« — Moine insolent, s’écria-t-il, je serai aussi spirituel que toi !
C’est dit. Tu as procès gagné ; car, jarnidieu ! — ta courtoisie l’a
deviné et c’est de cela que je te tiens compte ! — je me garderai
bien de te faire ce que tu as imaginé de faire à notre oie. Manges-en
donc ta part, et bois jusqu’à plus soif. Et j’ordonne, pour comble de
mansuétude, que tes perdrix te soient rendues tout-à-l’heure. Mais
qu’on ne te prenne plus à chasser sur mes terres, — car tu ne
trouverais pas une seconde fois si heureuse parade au coup
nouveau que je te porterais. »

Tous les auditeurs de Pablo riaient à ventre déboutonné ; et


Lecor dut convenir que, dans son genre, l’Oie d’Anselme valait bien
le Siège de Six-Fours.
— Seulement, ajouta-t-il, je la connaissais.
— Vous la connaissiez ? La raison en est, dit Pablo, que les très
bonnes histoires sont rares, et que, par suite, les meilleures sont les
plus souvent répétées.

— Allons, les amis, il se fait tard, déclara Gaspard. S’anén


coucar.
Ainsi firent-ils.
CHAPITRE XII

La visite extraordinaire de Gaspard au château de Fontblanche ; — et


comment la peur des voleurs jeta dans les bras de Gaspard une jeune et
belle marquise ; et comment l’infortune du vieux marquis fut, à bon droit,
imputée à l’abbé de Chaulieu.

C’est ici que se place une des plus curieuses aventures de


l’aventureux Gaspard.
Il résolut de rendre visite au château de Fontblanche, entre
Aubagne et Gémenos. Ce château était habité par Mme de Garnier
et sa fille.
Gaspard avait entendu dire que ces dames avaient de lui une
opinion peu favorable. On le leur avait représenté comme un bandit
farouche, violent, redoutable. Il résolut de les détromper, persuadé
que, si elles lui rendaient bon témoignage, sa réputation de partisan
généreux et courtois serait définitivement et brillamment fixée.

Ce jour-là, il y avait grande réception et bal chez les dames de


Garnier.
« Gaspard arriva flanqué de deux hommes qu’il posta aux deux
portes du château. Ils étaient armés de tromblons effrayants mais
chargés à poudre seulement, car sa maxime inviolable était : Ne
tuez jamais.
« Gaspard franchit le vestibule du château, jeta son manteau à
un valet, et on vit apparaître à la porte du salon, au milieu d’une
danse commencée, un beau gentilhomme non invité, qui s’annonça
lui-même en ces termes : « On m’a dit, Mesdames, qu’on vous avait
alarmées avec des histoires effrayantes sur un certain Gaspard de
Besse, terrible bandit ; j’ai voulu vous le présenter. »
« Et comme tous les yeux se tournaient vers la porte et que la
panique commençait à faire blêmir plus d’un front, à la pensée de
voir apparaître une sordide figure de brigand, Gaspard ajouta avec
calme : « Ne cherchez pas ailleurs, Mesdames et Messieurs ! C’est
bien moi qui vous présente et représente Gaspard de Besse. »
« A la stupeur générale succédait immédiatement un sentiment
de curiosité, non dépourvu d’admiration, devant ce beau et doux
jeune homme, suppliant qu’on n’interrompît pas la pavane, qu’il avait
suspendue par son arrivée, et s’excusant (par pure coquetterie) de
ne pas savoir d’autres danses que celles de son village.
« Je crois bien, disait Mme de Garnier à sa fille, de qui un de nos
amis tient ces détails authentiques [8] , je crois bien que plusieurs de
ces demoiselles se seraient vantées volontiers d’avoir dansé avec le
si joli brigand, à la chevelure artistement bouclée.
[8] Ce récit est tiré des Miettes de l’histoire de
Provence, par Stephen d’Arve, vicomte de Catelin ; Aix,
Dragon, éditeur. L’auteur le tenait de M. Louis de Bresc,
président distingué de l’Académie d’Aix. M. de Bresc est
mort en 1910. Il avait entendu, dans sa jeunesse, Mlle de
Garnier, fort âgée, rendre ce témoignage à Gaspard.

« On l’entourait, on le forçait d’accepter des rafraîchissements,


on lui fit raconter quelques drôlatiques histoires d’Anglaises dont il
imitait les premières terreurs et la gracieuseté ensuite. Il disait ne
vouloir faire qu’une concurrence à la douane du gouvernement, en
prélevant un impôt sur l’or et l’argent anglais ou italien entrant en
France. Son domaine, disait-il encore, s’arrêtait à la grande route ; et
il ajoutait qu’il n’avait jamais tué personne, dévalisé de châteaux ou
enfoncé des portes. Nulle parenté avec nos cambrioleurs modernes.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like