100% found this document useful (7 votes)
69 views

A Python Data Analyst's Toolkit: Learn Python and Python-Based Libraries With Applications in Data Analysis and Statistics Gayathri Rajagopalan

Learn

Uploaded by

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

A Python Data Analyst's Toolkit: Learn Python and Python-Based Libraries With Applications in Data Analysis and Statistics Gayathri Rajagopalan

Learn

Uploaded by

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

Download the full version of the textbook now 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/

Explore and download more textbook at https://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/

textbookfull.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/

textbookfull.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/

textbookfull.com

Coarse-Grained Modeling of Biomolecules 1st Edition


Garegin A. Papoian

https://textbookfull.com/product/coarse-grained-modeling-of-
biomolecules-1st-edition-garegin-a-papoian/

textbookfull.com
Visible Light Active Photocatalysis Nanostructured
Catalyst Design Mechanisms and Applications 1st Edition
Srabanti Ghosh
https://textbookfull.com/product/visible-light-active-photocatalysis-
nanostructured-catalyst-design-mechanisms-and-applications-1st-
edition-srabanti-ghosh/
textbookfull.com

Hybrid Intelligent Systems 15th International Conference


HIS 2015 on Hybrid Intelligent Systems Seoul South Korea
November 16 18 2015 1st Edition Ajith Abraham
https://textbookfull.com/product/hybrid-intelligent-systems-15th-
international-conference-his-2015-on-hybrid-intelligent-systems-seoul-
south-korea-november-16-18-2015-1st-edition-ajith-abraham/
textbookfull.com

Fundamentals and Applications of Supercritical Carbon


Dioxide SCO2 Based Power Cycles 1st Edition Klaus Brun

https://textbookfull.com/product/fundamentals-and-applications-of-
supercritical-carbon-dioxide-sco2-based-power-cycles-1st-edition-
klaus-brun/
textbookfull.com

Fundamentals of Software Engineering 5th Edition Mall

https://textbookfull.com/product/fundamentals-of-software-
engineering-5th-edition-mall/

textbookfull.com

Sexual conduct the social sources of human sexuality


Gagnon

https://textbookfull.com/product/sexual-conduct-the-social-sources-of-
human-sexuality-gagnon/

textbookfull.com
Disrupting Logistics Christian Wurst & Luca Graf

https://textbookfull.com/product/disrupting-logistics-christian-wurst-
luca-graf-2/

textbookfull.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
[email protected], 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 [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
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
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
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
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
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
Random documents with unrelated
content Scribd suggests to you:
22. Contopus borealis.—One bird seen.
23. Contopus virens richardsoni.—Common.
24. Chordiles virginianus henryi.—In dead timber, common.
25. Picus villosus.—Young of perhaps a week old were found on
the 25th of June.
26. Picoides arcticus.—Rather common.
27. Picoides americanus dorsalis.—Two or three specimens
noted.
28. Melanerpes erythrocephalus.—One bird observed.
29. Colaptes mexicanus.—Common. The young of this species
doubtless hatching on June 28, as an old bird was seen carrying out
and dropping, a hundred or two yards from the nest, the fragment of
an egg shell at that time.
30. Buteo borealis.—Hawks apparently of this species
occasionally observed.
31. Bonasa umbellus umbelloides.—Not common. Is mostly
found in the cottonwood timber of the valleys.
32. Tetrao obscurus richardsoni.—Not as common here as in
some other localities of the Belt Mountains. They prefer rough and
rocky ledges with only a moderate growth of fir to denser forests.
Occasionally one finds them outside of the mountains, but only
among the scattered clumps of fir growing on the high bluffs of some
of the streams. Their “tooting” is a low, muffled sort of cooing,
uttered without vigor, or any visible effort on the bird’s part, which
may be squatting on some rock at the time.
33. Tringoides macularius.—Found on the streams.—R. S.
Williams, Benton, W. T.

Remarks on Some Western Vermont Birds.—The Red-headed


Woodpecker (Melanerpes erythrocephalus, Sw.), is a strangely
erratic species. Mr. C. S. Paine has taken but a single specimen in the
eastern part of the State, and five years ago it was a very rare species
about here (Brandon). Now they are nearly as abundant as the
common Golden-wings. At Orwell, only ten miles to the west, they
outnumber the Golden-wings, and appear to be on the increase. Dr.
C. H. Merriam mentions (Bull. Nutt. Ornith. Club, Vol. III, No. 3, p.
124) their remaining in Northern New York during some of the
severest winters known. I have never observed them in this vicinity
later than the 2d of October, except in one instance (January 7,
1879), when I took a single specimen. At Rutland, sixteen miles
south of Brandon, Mr. Jenness Richardson informs me that they are
a resident species, being as abundant in winter as in summer. They
were particularly abundant about here during August and
September, 1879, being attracted, no doubt, by the great abundance
of black cherries (Prunus serotina), which they appear to relish
greatly. I have frequently observed this species to employ the same
nest for several successive seasons.
The Pileated Woodpecker (Hylotomus pileatus, Bd.), is by no
means as rare as might be expected in so thickly populated a section.
Not a year passes but that from one to five specimens are taken. I
have notes of at least fifteen specimens, taken during the last four or
five years, all of which occurred from the month of September to
May, inclusive; the last record being the capture of two young
females, September 28, 1881. Of the remaining Picidæ, Sphyrapicus
varius is a rather rare summer visitant; Picoides arcticus, a very rare
winter visitant: while Picus pubescens and P. villosus are resident
species, the former being by far the most abundant.
During the winter of 1880–81, no less than seven specimens of the
little Acadian Owl (Nyctale acadica) were taken, all within a few
days’ time. Two specimens of the Snowy Owl (Nyctea scandiaca)
were also taken at the same time. During the fall of 1879, a fine
specimen of the American Raven (Corvus corax carnivorus)
remained in this immediate vicinity for nearly a month, but
successfully eluded capture. A single specimen of the Canada Jay
(Perisoreus canadensis) was taken in December, 1874.
Although the recorded instances of the breeding of the Loggerhead
Shrike (Lanius ludovicianus) in New England are rather numerous,
the following notes may not be entirely devoid of interest. One rainy
day last season (June 5, 1880) as I was seated on the porch of a
neighbor’s house, my attention was attracted by a Shrike flying past
several times. I watched the bird and saw it fly to the top of an old
apple tree. The tree was not more than two rods from the house, and
was densely overrun with a large grape vine. I climbed the tree, and,
about twenty feet from the ground, found the nest, and, much to my
disappointment, found no eggs, but four nearly fledged young. The
old birds were very tame, and flew about within a few feet of my
head.
This season I visited the locality May 16, and was fortunate enough
to find a nest and four fresh eggs. The nest was in an apple tree,
perhaps three rods from the nest of last year; was composed of
coarse sticks and weeds, very deeply hollowed, and lined with wool
and twine. I took both parent birds with the nest, thus rendering the
identification positive.
A few days after this (May 23, 1881) some boys told me they had
found a “Cat Bird’s” nest in an apple tree about a mile from the
vicinity of the other nests. They had climbed the tree, and said “the
old bird flew at them, and snapped her bill hard!” I knew this to be a
Shrike, and, when I visited the place, had the pleasure of securing
another nest, containing six eggs, with the female parent. The nest
was much like the other, but was perhaps deeper, and lined entirely
with feathers.
The Great Northern Shrike (Lanius borealis) is a rather rare
species, being most frequently observed in spring.
The Scarlet Tanagers (Pyranga rubra) first made their appearance
about here in the summer of 1875, when a single pair nested. Since
then they have gradually increased until probably twenty pairs
nested the past season. Strange as it may seem, I have never taken
the common Titlark (Anthus ludovicianus) during the spring
migrations, although they are usually abundant in the fall.—F. H.
Knowlton, Brandon, Vt.

Erratum.—In Vol. VI, p. 199, lines 9 and 10. for “centimeters”


read millimeters.
BULLETIN
OF THE
NUTTALL ORNITHOLOGICAL CLUB.
VOL. VII. April, 1882. No. 2.
ON A COLLECTION OF BIRDS LATELY
MADE BY MR. F. STEPHENS IN ARIZONA.
BY WILLIAM BREWSTER.

Early in 1881 I wrote to Mr. Stephens asking him to get me some


Arizona birds during the following spring and summer. He replied
that he was on the point of starting by wagon for California, but that
being provided with a camping outfit, and feeling under no necessity
of hurrying by the way, he was willing to give his whole attention, for
several months at least, to collecting in my interest. It was
accordingly arranged that the journey should take in as great a
variety of country as possible, and, that the most productive points
should be thoroughly worked. The energy, intelligence, and
conscientiousness with which this plan was carried out are
sufficiently attested by the material results upon which the present
paper is based.
The route traversed was substantially as follows: Leaving
Galeyville on March 3, Mr. Stephens drove southward to Cave Creek,
where a few days’ collecting yielded a limited number of birds. At the
end of this time he retraced his steps to Galeyville, and continuing
northward, passed Camp Bowie, and crossed to the western side of
the Chiricahua Mountains. Here a halt was made at Morse’s Mill,
after a journey of seventy miles by wagon-road from Cave Creek,
although the distance is less than twelve miles in an air line. This
place is described in the notes as being at the head of a cañon, in a
sort of basin, elevated about seven thousand feet above the sea, and
encircled by mountains which rise from two to three thousand feet
higher.
From some further remarks on the general character of the range,
I quote the following: “The Chiricahua Mountains are situated in the
southeast corner of Arizona, some of the foot-hills even reaching the
line of New Mexico and the Mexican state of Sonora. Several small
streams run east and west from their summits, those of the former
division emptying into the San Simon Valley; of the latter into the
Sulphur Spring and San Bernardino Valleys. The first two water-
sheds are comprised in the Rio Gila system, while the San
Bernardino Valley stretches southward, and water from it flows into
the Pacific near Guaymas.”
“These valleys are usually grassy plains, but there are scattering
bushes, mostly mesquite, in some of them. The scrub oaks begin with
the foot-hills; they are evergreen, the leaves being insensibly
replaced with new ones in May. A little higher the juniper (called
‘cedar’ by the people here) comes in. Still higher, on the north side of
the hills, there is a little piñon and scrub pine, while the summits are
heavily timbered with red and black pines. In the gulches some fir
grows, and on the hillsides, mostly near the summits and facing the
north, occasional patches of aspen.”
At Morse’s Mill three weeks were very profitably spent, and on
April 1 a start was made for Tucson, the next objective point. The
route led through Sulphur Spring Valley, Tombstone, and Cienega
Station, and at all these places, as well as at some intermediate
points, a longer or shorter stay was made for the purpose of
collecting. These delays consumed so much time that Tucson was not
reached until April 18.
The country lying about this town and the neighboring station,
Camp Lowell, proved so rich in desirable birds that it engaged Mr.
Stephens’ attention for nearly the whole of the two succeeding
months, during which, however, a brief visit was paid to the Santa
Rita Mountains, where some important observations were made.
The season practically ended with June, for the wagon-journey,
begun on the 29th of that month, across the arid plains and
scorching deserts of middle and western Arizona, was attended with
such privations, and often positive suffering, that little attention
could be paid to birds. Mr. Stephens arrived at Yuma on July 15, and
by August 1 reached his final destination, Riverside, California.
The entire trip yielded about six hundred and fifty skins besides a
fairly large number of nests and eggs. Under the terms of our
agreement I had all the birds, a representative series of the nests and
eggs, and the field notes relating to both. This collection, embracing
the results of four months’ uninterrupted work in a region as yet only
imperfectly known, seems to me too complete in itself to be merely
skimmed of its cream. Accordingly in preparing the following paper I
have included every species which is represented among the
specimens or mentioned in the collector’s notes. It should be
understood, however, that the latter were not kept with reference to
this plan, and it is not unlikely that certain common birds, which are
known to occur in Arizona, were inadvertently omitted. For similar
reasons, the number of specimens obtained can seldom be taken as
an exponent of the relative abundance of the species to which they
belong, as a decided preference was given to the rarer kinds. Three
species new to the “North American” fauna have already been
announced (this Bulletin, Vol. VI, p. 252.).
A few technical points require explanation. The catalogue numbers
are usually those of the collector’s field-book, but in certain cases—as
of specimens taken as types, or with birds obtained by Mr. Stephens
before starting on the present trip—I have used my own numbers,
either alone or in connection with the original ones. This double
system need cause no confusion, however, for the field-numbers
never reach 700, while those of my general catalogue are always
above 5,000. Of the measurements, the length and stretch were
taken in the field, the others from the dry skins. The biographical
matter is of course based on Mr. Stephens’ notes, which are
sometimes paraphrased, sometimes literally quoted, as convenience
dictates. The frequent quotations of Mr. Henshaw’s experience or
opinions are always, unless otherwise stated, from his Report in
Volume V of “Explorations and Surveys West of the One Hundredth
Meridian.”

1. Turdus unalascæ Gmel. Dwarf Thrush.—The only Hermit


Thrush in the present collection is unmistakably referable to var.
unalascæ. In fact it gives nearly the same measurements as the
smallest extreme in the large series examined by Mr. Henshaw.[40]
Mr. Stephens marks it as the first which he has seen in Arizona
where, however, it was found sparingly by Mr. Henshaw in October,
1873.
283, ♀ ad., Tucson, April 25. Length, 6.40; extent, 10.10; wing. 3.26; tail, 2.61;
culmen, .52. “Bill dark brown, yellowish at base of lower mandible; legs pale
brownish; iris brown.”

2. Turdus ustulatus Nutt. Russet-backed Thrush.—Under this


heading I include with some hesitation, a Thrush killed May 17, in
the Santa Rita Mountains. The specimen unfortunately was one of
three or four which were accidentally destroyed while in the
collector’s possession, but Mr. Stephens is positive that it was
referable to the above variety. As he is perfectly familiar with
ustulatus, having previously met with it in California, there can, I
think, be little doubt of the correctness of his determination. This
record, if accepted, will make the first for Arizona.

397, ♀ ad., Santa Rita Mountains, May 17. Length, 6.90; extent, 10.70; “Iris dark
brown; bill black, brownish at base of lower mandible; legs very pale brown.”

3. Turdus migratorius propinquus Ridgw. Western Robin.—


Robins were met with only in or near the Chiricahua Mountains,
where perhaps a dozen individuals were seen. The one mentioned
below is typical of the slightly differentiated, but still apparently
constant western race.

75, ♂ ad., Morse’s Mill, March 20. Length, 10; extent, 16.40; wing, 5.38; tail,
4.36. “Iris dark brown.”

4. Oreoscoptes montanus (Towns.) Baird. Mountain


Mockingbird. There is no mention of this species among the notes
made during the late trip.

6313 (author’s coll.), ♀ ad., San Pedro River, Dec. 25, 1880. Length, 8.90; extent,
12.40.

5. Mimus polyglottus (Linn.) Boie. Mockingbird.—“Generally


distributed and common, but not as abundant as in Southern
California” (Camp Lowell). “Common in the valleys; they are found
but a short distance up the foot-hills of the mountain ranges” (near
Tombstone).

181, ♀ ad., near Tombstone, April 8. Length, 9.80; extent, 13.10; wing, 4.30; tail,
5.03.

550, ♂ ad., Camp Lowell, June 20. Length, 10.20; extent, 14.10; wing, 4.40; tail,
5.20. “Iris golden brown; bill and legs black.”

6. Harporhynchus bendirei Coues. Bendire’s Thrasher.—Mr.


Stephens’ notes contain few references to this species, and judging
from the limited number of specimens which he obtained, it must be
less abundant in Arizona than either H. crissalis or H. curvirostris
palmeri, a status which is in strict accordance with Mr. Henshaw’s
experience. About half of the skins collected during the past season
are labeled either Camp Lowell or Tucson, while the remainder were
taken at various points directly north or south of the latter place, and
not over twenty-five miles distant in either direction. Outside the
limits of this desert region the bird was not anywhere met with,
although it was common at Phœnix in February, 1880.
A nest taken June 16 near Tucson, and identified by the capture of
one of the parent birds, was placed in a “cat-claw mesquite” at a
height of about five feet from the ground. It is a deeply-hollowed,
smoothly-lined structure, composed of fine grasses and soft, hemp-
like vegetable fibres, which are protected externally, in a manner
common to the nests of nearly all Thrashers, by a bristling array of
interlaced twigs and thorny sticks. The interior cup measures two
inches in depth by three in width. The two eggs which it contained,
like those described by Dr. Coues, are readily separable from eggs of
H. palmeri by their grayish-white instead of dull green ground-color.
They are faintly marked with reddish-brown and lavender, the spots
being confined chiefly to the larger ends, where many of them
assume the character of blotches or dashes of color. These eggs
measure respectively 1.02 × .79 and .96 × .79. The greatest number
of eggs found in any of the several nests examined by Mr. Stephens
was three, but two seemed to be the usual complement.
Of the birds before me four are in first plumage, a stage which, if I
am not mistaken, has never been previously examined. The first of
these (No. 426, twenty-five miles south of Tucson, May 22) was
unable to fly, and was taken from the nest. It differs from the adult in
the following particulars: The upper parts, with nearly the same
ground-color, have a tinge of reddish-brown which, on the rump,
wing-coverts, and tips and outer webs of the primaries and
secondaries, shades into brownish-chestnut. The sprouting rectrices
are also tipped with the same color. The under parts generally are
warm fulvous, which becomes nearly pure cinnamon on the sides
and crissum, and along the median line pales to fulvous-white. The
breast and abdomen are everywhere thickly but finely spotted with
dull black, these markings becoming finer and fainter where they
border on the anal region. The remaining three (Nos. 538, ♀; 539, —;
and 540, ♂ : twenty-five miles north of Tucson, June 16) have the
wings fully developed, and were all out of the nests when shot. They
are apparently of about the same respective ages, but nevertheless
exhibit a good deal of individual variation. No. 538 has the breast
and sides finely spotted with dark brown, but a central space
extending forward along the abdomen nearly to the breast is entirely
unmarked. No. 535 has large, rounded, but indistinct blotches of
light brown, thickly and evenly distributed over the entire under
parts, excepting the throat, anal region and crissum. No. 539 has a
cluster of faint, sagittate spots on the centre of the breast, but
otherwise is entirely immaculate beneath. All three are essentially
similar above, and differ from No. 426 in having the crown, nape,
back, wing-coverts and outer webs of the secondaries pale reddish-
brown, which, on the rump, is only tinged with chestnut. The
primaries are dark brown edged with hoary; the rectrices, dull black
with a terminal band of pale reddish-chestnut crossing both webs of
all the feathers, but most broadly those of the outer pairs.
The adults making up the rest of this series vary a good deal with
the season at which they were taken. A specimen killed in February is
clear grayish-brown above, with the breast and abdomen thickly
spotted; and one or two others shot early in May are nearly as deeply
colored and distinctly marked. But most of the breeding birds are
either entirely immaculate beneath, or with only a few faint specks
scattered here and there upon the abdomen. Several of the latter are
nearly as pale as my specimens of H. lecontei, and equally devoid of
any special markings. This condition apparently is due mainly to the
wearing off of the tips of the feathers, although the continued action
of the sun’s rays doubtless lends its aid, and still further bleaches the
plumage.
453, ♂ ad., Camp Lowell, May 30. Length, 10.30; extent, 13.30.
4987, (author’s coll.) ♂ ad., Tucson, Feb. 28, 1880. Wing, 4.25;
tail, 4.84; culmen (chord), .99.
423, ♂ ad., twenty-five miles south of Tucson, May 21. Length,
10.40; extent, 14.20; wing, 4.30; tail, 4.92; culmen, 1.06.
425, ♂ ad., same locality, May 22. Length, 10.30; extent, 13.10;
wing, 4.01; tail, 4.96; culmen, 1.05.
455, ♂ ad., Camp Lowell, May 30. Length, 10.18; extent, 13.30;
wing, 4.20; tail, 4.96; culmen, 1.05.
537, ♂ ad., twenty-five miles north of Tucson, June 16. Length,
10.10; extent, 12.70; wing, 4.14; tail, 4.78; culmen, 1.01.
583, ♂ ad., Camp Lowell, June 24. Length, 10.50; extent, 13; wing,
3.99; tail, 4.95; culmen, 1.05.
454, ♀ ad., Camp Lowell, May 30. Length, 10.10; extent, 12.70;
wing, 3.95; tail, 4.43; culmen, 1.
529, ♀ ad., twenty-five miles north of Tucson, June 16. Length,
10.20; extent, 12.10; wing, 3.63; tail, 4.50; culmen, 1.01. “Iris yellow;
legs dull bluish.”
557, ♀ ad., Camp Lowell, June 21. Length, 10; extent, 13.20; wing,
4.10; tail, 4.60; culmen, .95.
426, ♀ juv. first plumage, twenty-five miles south of Tucson, May
22. Length, 6.10; extent, 9.40; “Iris light gray; bill dark brown,
lighter below; legs pale bluish.” Taken from the nest; wings and tail
only partly developed.
538, ♀ juv. first plumage, twenty-five miles north of Tucson, June
16. Length, 10.10; extent, 12.50; wing, 3.77; tail, 4.59; culmen, .96.
539, — juv. first plumage, same locality and date. Length, 9.80;
extent, 12.70; wing, 3.92; tail, 4.67; culmen, .92.
540, ♂ juv. first plumage, same locality and date. Length, 10;
extent, 12.80; wing, 3.90; tail, 4.55; culmen, .95.
7. Harporhynchus curvirostris palmeri Ridgw. Palmer’s
Thrasher.—During the present trip this Thrasher was met with at
various points in the desert region about Tucson and Camp Lowell,
where it was one of the most abundant and characteristic summer
birds. Its favorite haunts were barren wastes covered with cactuses
and stunted mesquites; but, like many other desert species, it
occasionally visited the more fertile valleys to drink at the springs
and water-holes. At these latter places specimens were obtained
without much difficulty, but on all other occasions they were
exceedingly shy and wary. In February, 1880, Mr. Stephens found
Palmer’s Thrasher at Phœnix, and he also took winter specimens
along the San Pedro River.[41]
Numerous nests were taken. The one before me was placed in a
cholla at a height of about seven feet. It is composed outwardly of
large twigs, and is lined with bleached grasses. Although by no
means a rude structure, it suffers by comparison with the nest of H.
bendirei, its construction being simpler, and all the materials much
coarser. The three eggs which it contained were only slightly
incubated on June 14. They measure respectively 1.05×.82, 1.09×.82,
and 1.08×.83. They are pale greenish-blue, finely and very evenly
spotted with brown and lavender. The number of eggs making up
this set was not exceeded in any of the others examined by Mr.
Stephens.
The series of skins embraces no less than twenty-two examples,
and very fully illustrates all the variations of age and season. Among
the number are several in the hitherto undescribed first plumage.
The

youngest of these (No. 480, ♂?, Camp Lowell, June 2), although well feathered,
has the wings and tail undeveloped, and was taken from the nest. Its entire upper
plumage is rusty brown with a chestnut tinge which deepens on the rump and
outer webs of the secondaries to decided chestnut brown. The general coloring of
the under parts is pale fulvous with a strong tinge of rusty chestnut across the
breast, along the sides, and over the anal region and crissum. The breast is
obsoletely spotted, but the plumage elsewhere, both above and below, is entirely
immaculate. An older bird (No. 577, Camp Lowell, June 23) with the wings and tail
fully grown out, differs in having the back (excepting a narrow anterior space
bordering on the nape), with the exposed webs and coverts of the wings, and a
broad tipping on the tail feathers, bright rusty;—while in a third of about the same
age (No. 614, ♂ , Camp Lowell, June 28), the rusty color, although paler, is
uniformly distributed over the entire upper surface save upon the wings and tail
feathers, which are only edged and tipped with that color. This last example is so
faintly marked beneath that the plumage at first sight appears immaculate; but a
closer inspection reveals a few spots here and there among the central feathers of
the breast. A fourth (No. 487, Camp Lowell, June 3), although apparently no older,
has the breast and sides spotted more sharply than in any of the adults, while the
rusty tinge above is chiefly confined to the rump, posterior half of the back, and the
outer webs of the wing feathers.
Several of these young birds are so nearly similar to specimens of H. bendirei in
corresponding stages that they can be separated only with great difficulty. The
stouter bill and entirely black lower mandible of palmeri may, however, always be
depended upon as distinguishing characters; and, moreover, the pectoral spotting
of bendirei is usually (but not invariably) finer and sharper, and the rusty tinge
above paler and less extended.
The adults present a good deal of variation, most of which is apparently
seasonal. Winter specimens have the lower abdomen, with the anal region and
crissum, rich rusty-fulvous, while the markings beneath are similar in character to
those of true curvirostris, and the spots equally distinct, numerous and widely
distributed. With the advance of the season, and the consequent wear and tear of
the plumage, the spots gradually fade or disappear. Indeed some of the June
specimens are absolutely immaculate beneath, although most of them, like Mr.
Ridgway’s types, have a few faint markings on the abdomen. In this condition the
general coloring is also paler and grayer, and the fulvous of the crissum and
neighboring parts often entirely wanting.
But although the evidence of this series tends to demolish several of the
characters upon which palmeri has been based, enough remain to separate it from
its ally the true curvirostris of Mexico and the Rio Grande Valley in Texas. The
best of these, perhaps, is to be found in the different marking of the tail feathers. In
curvirostris the three outer pairs are broadly tipped with pure white which, on the
inner web, extends twice as deep, basally, as on the outer one, and has its
boundaries everywhere sharply defined; in palmeri the outer rectrices are, at the
most, barely tipped with pale brown, which either extends squarely across both
webs, or fades insensibly into the darker color of the feather. The bill of palmeri,
also, is usually longer and more curved than that of curvirostris.

8. Harporhynchus lecontei Bonap. Leconte’s Thrasher.—The


great rarity of Leconte’s Thrasher, even in the heart of the desolate
regions where alone it has so far been found, is still further attested
by Mr. Stephens’ experience during the past season, for although he
searched for it carefully in all suitable places between Camp Lowell
and Riverside (California), he met with only two individuals. These
occurred about fifteen miles west of Maricopa, Arizona, in a locality
which the accompanying notes describe as follows: “Near the middle
of ‘Forty-five-mile Desert,’ between Maricopa Wells and Gila Bend.
No chollas or other cactuses in the immediate neighborhood, but
some giant cactuses about a mile away in the hills; a few mesquites
and much scattering low brush in the vicinity; nearest water twenty
miles away.”
Dr. Cooper is said to have found the species “rather common” in
the desert between Fort Mohave and the San Bernardino Mountains,
California, but Mr. Stephens has thrice traversed this route without
seeing a single specimen. In a recent number[42] of the American
Naturalist, however, Mr. E. Holterhoff, Jr., speaks of seeing the bird
“on the Colorado desert, at a station called Flowing Wells,” and gives
an interesting description of a nest and set of eggs taken there. “The
nest was placed in a palo verde tree, and was a very bulky affair,
measuring externally nine inches in depth and six in width; the
hollow of the nest was fully three inches in depth. It was so
awkwardly situated that much of the base of the nest had evidently
been filled in to firmly support the structure. The two eggs were
somewhat smaller than those of H. redivivus, lighter in color, and
marked all over with finer reddish spots, thicker at the larger end.”
I am inclined to consider the Maricopa specimens above referred
to as adults, although this is not so clear in the case of the male,
portions of whose plumage suggest that of a young bird. Both are in
worn, ragged condition, but there is no indication of any moult, save
upon the wings and tail, where many of the feathers have been
replaced by new ones which are conspicuous among the others by
their fresher coloring.
On a former occasion[43] I urged the specific distinctness of this
Thrasher from H. redivivus, and to this conviction I still hold,
although a comparison of additional specimens of both species
inclines me to believe with Dr. Coues that Leconte’s Thrasher is, on
the whole, more nearly related to redivivus than to any other United
States form.
616, ♂ ad., near Maricopa Wells, July 5. Length, 10.80; extent,
12.30; wing, 3.85; tarsus, 1.27; tail, 5.35; culmen (chord), 1.30; bill
from nostrils, .91; width below posterior angle of nostrils, .23.
617, ♀ ad., same locality and date. Length, 10.60; extent, 12; wing,
3.78; tarsus, 1.32; tail, 4.91; bill (chord of culmen), 1.32; bill from
nostril, .94; width below posterior angle of nostril, .24. “Iris reddish-
brown; bill black; legs nearly black. Stomach contained a small
species of katydid and some ants.”
9. Harporhynchus crissalis Henry. Crissal Thrasher.—Not
uncommon near Tombstone, Tucson and Camp Lowell.
Dr. Coues, comparing this species with Le Conte’s, Palmer’s, and
Bendire’s Thrashers, concludes:[44] “and we are led to infer that when
the ‘topography’ of the other three species is fully determined, it will
be found no less extensive. For there is nothing peculiar in the
economy or requirements of any one of the four in comparison with
the rest.” This view, however, is hardly supported by the testimony of
observers who have had the best opportunities of studying these
birds. The Crissal Thrasher, according to Captain Bendire,[45]
“appears to prefer damp localities near water-courses, and confines
itself principally to spots where the wild currant is abundant.” Mr.
Henshaw says: “According to my experience, it is not a bird of the
plains, but inhabits by preference the rough sides of rocky cañons or
the hillsides covered with broken débris, interspersed with straggling
bushes.” Mr. Stephens’ evidence is not less explicit. He found the
Crissal Thrasher in copses in valleys, and along streams. It was
especially fond of well-shaded undergrowth, and spent much of its
time on the ground, searching for food under the bushes. It never
occurred among cactuses, and the only place where he saw it actually
associating with Bendire’s and Palmer’s Thrashers, was at Camp
Lowell, where the latter species, with other desert birds, came to
drink at a water-hole and thus occasionally mingled with the Crissal
Thrashers which inhabited the neighboring thickets. The contrast
which these traits afford when compared with the ones
characterizing the other three species named by Dr. Coues, is
sufficiently apparent.[46]
A nest received from Mr. Stephens is precisely similar to those
found by Captain Bendire. The three eggs which it contained
measure respectively, 1.14×.76, 1.14×.75, and 1.08×.77. Like all the
specimens which have been previously reported they are entirely
unspotted, and both in size and color closely resemble eggs of the
common Robin.

Juv., first plumage ( ♀ , No. 546, Camp Lowell, June 20). Above dull reddish-
brown. Rump and a broad tipping on the tail, brownish-chestnut. Under parts
nearly uniform, brownish-fulvous. Crissum chestnut, of nearly the same shade as
in the adult. Maxillary stripes dusky brown. No trace of spots or other dark
markings either above or beneath.
Five other young birds in the series are essentially similar and call for no special
comment. I cannot find any description of the first plumage of either H. redivivus
or H. lecontei, but with the exception of these, H. crissalis is the only North
American species in the sub-family Miminæ whose young are entirely unmarked
beneath. It is interesting to note that with respect to the color of the upper parts,
especially that of the rump, they resemble the young of both H. bendirei and H.
palmeri.
The individual variation presented by the adults before me is chiefly confined to
the relative length and curvature of the bill, the general coloring of all being nearly
uniform, although the breeding birds are slightly paler than those taken early in
the season.
166, ♂ ad., near Tombstone, April 5. Length, 12.10; extent, 12.30; “Iris light
brown. Stomach contained insects and a small lizard.”
251, ♂ ad., Tucson, April 21. Length, 12.60; extent, 12.60; wing, 4.11; tail, 6.25;
chord of culmen, 1.56. “Iris light gray,—almost white.”
278, ♂ ad., Tucson, April 25. Length, 12.10; extent, 12.50; wing, 3.84; tail, 6.20;
culmen, 1.47.
309, ♂ ad., Tucson, April 30. Length, 11.70; extent, 12.70; wing, 4.05; tail, 5.85;
culmen, 1.53.
434, ♂ ad., Tucson, May 25. Length, 11.20; extent, 12.30; wing, 4.02; tail, 5.52;
culmen, 1.43.
503, ♂ ad., Tucson, June 8. Length, 11.40; extent, 12.10; wing, 3.85; tail, 5.85;
culmen, 1.46.
578, ♂ ad., Camp Lowell, June 23. Length, 11.60; extent, 12.60; wing, 4.05; tail,
5.75; culmen, 1.45.
437, ♂ juv., first plumage, Tucson, May 26. Length, 11.30; extent, 12.40; wing,
3.92; tail, 5.50; culmen, 1.18.

595, ♂ juv., first plumage, Camp Lowell, June 25. Length, 11.60; extent, 12.50;
wing, 3.84; tail, 6.18; culmen, 1.35.
596, ♂ juv., first plumage, Camp Lowell, June 25. Length, 11.80; extent, 12.60;
wing, 3.86; tail, 6.12; culmen, 1.40.
436, ♀ ad., Tucson, May 25. Length, 11.80; extent, 12.40; wing, 3.90; tail, 5.90;
culmen, 1.55. Parent of No. 435.
435, ♀ juv., first plumage, same locality and date. Length, 11.30; extent, 12.20;
wing, 4.02; tail, 5.55; culmen, 1.20.
546, ♀ juv., first plumage, Camp Lowell, June 20. Length, 11.60; extent, 12.40;
wing, 4.95; tail, 6.02; culmen, 1.38.
555, ♀ juv., first plumage, Camp Lowell, June 21. Length, 11.30; extent, 12.20;
wing, 3.73; tail, 5.65; culmen, 1.42.

10. Cinclus mexicanus Swains. American Water Ouzel.—The


following notes relate to the only specimen met with:
“My attention was called to the song of some bird which came
from the mountain brook running past camp. There was a steep,
rocky wall on the further side, and the notes echoing from it, and
mingling with the purling of the water, sounded exquisitely sweet.
On looking for the author, I noticed some ripples rolling out from
behind the willows that fringed the nearer shore, and soon
discovered an Ouzel dabbling in the shallow water. My shot wounded
the bird, but did not disable its wings, for it repeatedly dived, using
them as propelling agents when beneath the surface. The sun shining
on the air-bubbles that clung to its plumage made it look like a ball of
silver flying through the water. On the surface it paddled along very
much in the manner of a Phalarope.”

79, ♂ ad., Morse’s Mill, Chiricahua Mountains, March 20. Length, 7.90; extent,
12.10; wing, 3.85; tail, 2.50. “Iris hazel. The flesh was dark and tough with a fishy
smell. The inside of the skin looked like that of a small Wader. Stomach contained
insects.”

11. Sialia mexicana Swains. Western Bluebird.—A single pair,


taken in the Chiricahua Mountains in March, are accompanied by
the note, “abundant in all kinds of timber.”
12. Sialia arctica Swains. Arctic Bluebird.—This species is
noted as “rare in the low valleys” among the Chiricahua Mountains.
A small flock was also seen near Galeyville on “grassy plains,” where
“they flew from one weed-stalk to another.” They were “restless and
rather shy.” The single specimen obtained was shot on this latter
occasion.
13. Myiadestes townsendi (Aud.) Caban. Townsend’s
Solitaire.—Three specimens were obtained in the Chiricahua
Mountains, where they occurred sparingly among piñons. “They are
rather tame, and have a habit of sitting perfectly still for several
minutes at a time. Flight slow. Food insects.” A fourth, taken May 13,
in the Santa Rita Mountains, completes the series.
14. Phaïnopepla nitens (Swain.) Scl. Black-crested
Flycatcher.—The life history of this singular bird has been so fully
given by Dr. Coues in “Birds of the Colorado Valley,” that there is
little chance of adding anything new. Most of the specimens obtained
by Mr. Stephens are from Camp Lowell and Tucson, but he did not
find it abundant at either of these points. He speaks of it as having “a
sweet but not loud song,” and remarks on its known fondness for
mistletoe berries. “Iris red.”
15. Polioptila cærulea (Linn.) Scl. Blue-gray Gnatcatcher.—
Eight specimens, representing the following localities: Chiricahua
Mountains (two ♂ , two ♀ , April 1–6); Tombstone ( ♂ , April 5);
Cienega Station ( ♂ , April 16); Tucson ( ♂ , April 20); Santa Rita
Mountains (♂, May 20).
16. Polioptila plumbea Baird. Black-capped Gnatcatcher.—
This Gnatcatcher was observed at Tucson, Camp Lowell, and near
Yuma, specimens being taken in all these localities. A female shot at
the first-named point on April 23 had evidently finished laying, but a
nest found June 27 near Camp Lowell contained a perfectly fresh
egg, while another taken at Yuma, July 15, had a single egg of its
owner and one of the Dwarf Cowbird. These dates indicate that the
species breeds at least twice during the season.
The Yuma nest, although a delicate structure, will not compare
with that of P. cærulea. It entirely lacks the exterior coating of
lichens so effectively employed by the commoner bird, and in its
general appearance closely resembles the Redstart’s well-known
domicile, being similarly felted of soft bark strips and hemp-like
vegetable fibres. It is lined with down from plants, a few feathers,
and the hair of some small quadruped. Externally it measures 2.25 in
width by 1.55 in depth; internally 1.45 by 1. The egg is pale greenish-
blue, coarsely and very evenly spotted with reddish-brown. Its
measurements are .53×.42. This nest was placed in a bunch of
mistletoe, at a height of about eight feet from the ground. It is
accompanied by the male parent, who revealed its position by
repeatedly entering the mistletoe. and showing other signs of anxiety
respecting its contents. The position of the Camp Lowell nest is not
mentioned.

Juv., first plumage, ♀ (No. 619, Yuma, July 15). Crown pale cinereous; rest of
upper parts faded brown. The wings are uniform with the back, but all the
primaries and secondaries have a broad white edging on their outer webs. The tail
is dull black, with white areas on the outer rectrices corresponding in extent and
purity with those of the adult. Beneath, pale ashy-white.
A study of the large series of Gnatcatchers collected during the past season
confirms the views which I lately advanced (this Bulletin, Vol. VI, p. 101) regarding
the affinity of P. plumbea and P. “melanura,” and also affords additional evidence
of the assumed specific distinctness of P. californica. The Yuma examples of P.
plumbea are quite as typical as those taken at Tucson and Camp Lowell, while
seven specimens of californica, collected at Riverside after Mr. Stephens’ return to
that place, still further attest the constancy of most of the characters which I
assigned to the latter bird. That relating to the brown edging of the secondaries
will, however, have to be abandoned, for plumbea proves to be similarly
characterized when in worn breeding dress; the supposed shorter tail of californica
also is now shown to be an inconstant feature. All of the three young males taken at
Riverside have black lateral crown-stripes like those of immature plumbea.
267, ♂ ad., Tucson, April 23. Length, 4.60; extent, 5.80; wing, 1.85; tail, 2.15; bill
(from nostril) .25; tarsus, .67. “Iris dark brown;” lores ashy mixed with black;
eyelids white.
500, ♂ ad., Tucson, June 7. Length, 4.60; extent, 5.80; wing, 1.81; tail, 2.12; bill
(from nostril), .25; tarsus, .65. Lores ashy mixed with black; upper eyelid white.
564, ♂ ad., Camp Lowell, June 22. Length, 4.55; extent, 5.80; wing, 1.84; tail,
2.19; bill (from nostril), .25; tarsus, .70. Lores black; both eyelids white.
567, ♂ ad., Camp Lowell, June 22. Length, 4.40; extent, 5.60; wing, 1.84; tail,
2.16; bill (from nostril), .26; tarsus, .70. Lores and superciliary line white mixed
with black.
581, ♂ ad., Camp Lowell, June 24. Length, 4.40; extent, 5.80; wing, 1.98; tail,
2.20; bill (from nostril), .28; tarsus, .70. Lores ashy.
618, ♂ ad., Yuma, July 15. Length, 4.40; extent, 5.80; wing, 1.90; tail, 2.15; bill
(from nostril), .26; tarsus, .68. Lores, with broad superciliary lines meeting across
the forehead, white.
621, ♂ juv., first plumage, Yuma, July 16. Length, 4.40; extent, 5.60; wing, 1.76;
tail, 2.13; bill (from nostril), .26; tarsus, .72. Sides of head ashy-white; ill-defined,
black, lateral crown-stripes partially concealed.
272, ♀ ad., Tucson, April 23. Length, 4.50; extent, 5.50; wing, 1.78; tail, 2.21; bill
(from nostril), .27; tarsus, .68. “Had just finished laying.”
458, ♀ ad., Camp Lowell, May 31. Length, 4.50; extent, 5.50; wing, 1.86; tail,
2.13; bill (from nostril), .26; tarsus, .68.
601, ♀ ad., Camp Lowell, June 27. Length, 4.60; extent, 5.50; wing, 1.74; tail,
2.18; bill (from nostril), .27; tarsus, .70. “Taken with the nest and one fresh egg.”
619, ♀ juv., first plumage, Yuma, July 15. Length, 4.40; extent, 5.60; wing, 1.86;
tail, 2.12; bill (from nostril), .26; tarsus, .70.
566,—juv., first plumage, Camp Lowell, June 22. Length, 4.40; extent, 5.60;
wing, 1.85; tail, 2.22; bill (from nostril), .27; tarsus, .68.
For comparison I add measurements of the seven specimens of P. californica
above mentioned.
656, ♂ juv., fall plumage, Riverside, Sept. 16. Length, 4.55; extent, 5.70; wing,
1.67; tail, 2.20; bill (from nostril), .29; tarsus, .75.
658, ♂ juv., fall plumage, same locality and date. Length, 4.70; extent, 5.80;
wing, 1.89; tail, 2.21; bill (from nostril) .26; tarsus, .75.
688, ♂ juv., fall plumage, Riverside, Sept. 23. Length, 4.50; extent, 5.90; wing,
1.73; tail, 2.11; bill (from nostril), .30; tarsus, .75.
657, ♀ juv., fall plumage, Riverside, Sept. 16. Length, 4.60; extent, 5.80; wing,
1.85; tail, 2.14; bill (from nostril), .30; tarsus, .72.
686, ♀ juv., fall plumage, Riverside, Sept. 23. Length, 4.45; extent, 5.90; wing,
1.92; tail, 2.17; bill (from nostril), .30; tarsus, .75.
687, ♀ juv., fall plumage, same locality and date. Length, 4.50; extent, 5.80;
wing, 1.85; tail, 2.20; bill (from nostril), .28; tarsus, .70.
655, ♀ juv., fall plumage, Riverside, Sept. 16. Length, 4.45; extent, 5.75; wing,
1.86; tail, 2.15; bill (from nostril), .28; tarsus, .75.

17. Regulus calendula (Linn.) Licht. Ruby-crowned Kinglet.


—“Common among the Chiricahua Mountains, especially in
deciduous timber. I think a few summer and breed.” The following
specimens are identical with eastern ones:

28, ♂ ad., Cave Creek, Chiricahua Mountains, March 8. Length, 4.60; extent,
6.50; wing, 2.32.
122, ♂ ad., Morse’s Mill, March 28. Length, 4.20; extent, 6.90; wing, 2.38.
18. Lophophanes inornatus (Gamb.) Cass. Plain Titmouse.—
Mentioned in Mr. Stephens’ notes as rare on the foot-hills of the
Chiricahua Mountains, but no specimens are included in his
collection.
19. Lophophanes wollweberi Bonap. Wollweber’s Titmouse.
—This species was abundant in the Chiricahua Mountains, where a
fine series was collected. They were usually seen in flocks of six or
eight, and often associated with other small birds. They were rarely
met with excepting in the groves of “scrub oaks,” but their food
appeared to be wholly insects. A single pair taken in the Santa Rita
Mountains in May are unaccompanied by any special remarks.
20. Parus meridionalis Scl. Mexican Chickadee.—In a late
number of the Bulletin (Vol. VI, p. 252) I briefly announced this
important addition to the North American fauna. The series obtained
by Mr. Stephens comprises nine specimens, all of which were taken
near Morse’s Mill. They occurred upon the sides or summits of the
surrounding mountains, at elevations varying from seven to ten
thousand feet, and were usually found in pairs, although they not
unfrequently associated with other birds, among which are
mentioned Psaltriparus plumbeus, Lophophanes wollweberi, Sitta
pygmæa, and Peucedramus olivaceus. They were for the most part
silent, but occasionally uttered a “chee-wee-wee,” as well as notes
resembling those of P. montanus.
Previous writers have compared this species with P. atricapillus,
but to me it seems nearer related to P. montanus. With the latter it
agrees in certain peculiarities of size and proportions, while the
general coloring and markings of the two are so similar that almost
the only appreciable points of difference are presented by the white
forehead and head-stripes of montanus. These characters are, of
course, enough to instantly separate the birds, but their importance
is somewhat weakened by the fact that one of my specimens of
meridionalis (No. 124) possesses a head-stripe which, though ill-
defined and considerably shorter, is nevertheless similar in
appearance and position to that of montanus. While it would be rash
to argue any varietal affinity on the strength of this single specimen,
the outcropping of such a well-marked characteristic certainly shows
a close relationship between the two species, unless indeed No. 124
be regarded as a hybrid.
65, ♂ ad., Morse’s Mill, March 18. Length, 5.20; extent, 8.50; wing,
2.74; tail, 2.60. “Iris dark brown. Stomach contained insects.”
82, ♀ ad., Morse’s Mill, March 21. Length, 5.10; extent, 8.10; wing,
2.73; tail, 2.62.
83, ♂ ad., same locality and date. Length, 5.10; extent, 8.50; wing,
2.90; tail, 2.69.
99, ♀ ad., Morse’s Mill, March 24. Length, 4.70; extent, 7.90;
wing, 2.63; tail, 2.42.
100, ♂ ad., same locality and date. Length, 5.10; extent, 8.60;
wing, 2.76; tail, 2.65.
104, ♂ ad., Morse’s Mill, March 25. Length, 5.10; extent, 8.30;
wing, 2.75; tail, 2.40.
105, ♂ ad., same locality and date. Length, 5.10; extent, 8.20; wing,
2.66; tail, 2.56.
124, ♂ ad., Morse’s Mill, March 29. Length, 5.10; extent, 8.70;
wing, 2.85; tail, 2.68.
125, ♂ ad., same locality and date. Length, 5; extent, 8.20.
21. Psaltriparus plumbeus Baird. Lead-colored Tit.—Of the
eight specimens of this species which are included in the collection,
seven were taken in the Chiricahua Mountains, the remaining one
being from the Santa Rita Mountains. Mr. Stephens does not appear
to have found it elsewhere, and in his notes characterizes it as rather
uncommon. It was oftenest seen among the oaks of the foot-hills,
where it associated with Wollweber’s Titmouse, the Ruby-crowned
Kinglet, and several other small birds.
22. Auriparus flaviceps (Sundev.) Baird. Yellow-headed Tit.
—Mr. Henshaw while in Arizona met with but few specimens of this
curious little species. He attributed their apparent rarity to the
lateness of the season at which his observations were made, and
doubtless this explanation is the true one; for during the past spring
Mr. Stephens found them in abundance both at Cienega Station and
Tucson. Nevertheless it is probable that some individuals pass the
winter in Arizona, for one of my specimens is dated November 29,
and another was killed early in March. A nest taken at Tucson
contained three fresh eggs on April 20.
23. Sitta carolinensis aculeata (Cass.) Allen. Slender-billed
Nuthatch.—This Nuthatch was common in the pine forests of the
Chiricahua Mountains, but the notes do not mention its occurrence
elsewhere.
24. Sitta pygmæa Vig. Pygmy Nuthatch.—Equally common
with the preceding species in the same locality.
25. Certhia familiaris mexicana (Gloger) Ridgw. Mexican
Creeper.—Various writers have attributed the Mexican Creeper to
our fauna, either on purely inferential grounds, or from a
misconception, which at one time prevailed, regarding the
relationship of the form found in California; for up to the present
time no undoubted specimens of mexicana have been taken within
our boundaries. It accordingly gives me much pleasure to announce
the actual occurrence in Arizona of this well-characterized race, of
which the specimen mentioned below is perfectly typical. It is the
only Creeper which Mr. Stephens met with during the past season,
but in the previous year two others, which I have not examined, but
which he considers identical with this, were taken in the same
locality. All the Arizona specimens obtained by Mr. Henshaw were
referred to our eastern form.

66, ♀ ad., Morse’s Mill, Chiricahua Mountains, March 18. Length, 4.80; extent,
7.10; wing, 2.45; tail, 2.25; culmen, .50. “Iris dark brown.”

26. Campylorhynchus brunneicapillus (Lafr.) Gray. Cactus


Wren.—I notice little of special interest among the notes
accompanying the eight skins which Mr. Stephens collected. He
found the bird abundant in all suitable localities, and took several
nests and sets of eggs. The unsophisticated young were easily shot,
but the adults, even when breeding, were shy and hard to secure.
27. Salpinctes obsoletus (Say) Caban. Rock Wren.—Mr.
Stephens makes no mention of finding this species in Arizona during
the past season, but he sends me a single specimen taken December
25, 1880, on the San Pedro River.
28. Thryomanes bewicki leucogaster Baird. White-bellied
Wren.—The collection includes five specimens of this form, which
was apparently met with only in the Chiricahua Mountains and
about Tucson. In the former locality it was common along the banks
of streams where, however, it kept so closely hidden among the
weeds and brush that it was oftener heard than seen. The examples
before me are typical.
29. Troglodytes aëdon Vieill. House Wren.—The only House
Wren taken is absolutely indistinguishable from many of my
Massachusetts specimens, and I accordingly refer it here.
Furthermore, I fail to find the characters supposed to distinguish var.
parkmani, in any of the several California specimens included in my
series. If the latter form really possesses any constant differential
characters, I believe they have yet to be defined.

169, ♀ , near Tombstone, April 6. Length, 4.80; extent, 6.40; wing, 2.10. “Iris
dark brown. Shot among low brush. Not common.”

30. Anthus ludovicianus (Gm.) Licht. American Titlark.

271, ♀ ad., Tucson, April 23. Length, 6.50; extent, 10.60. “Bill brown, paler at
base below; legs brown.” Several seen in marshes along the stream.

31. Helminthophila luciæ (Coop.) Ridgw. Lucy’s Warbler.—


Although this diminutive Helminthophila has been known to
ornithologists for nearly twenty years, few specimens have found
their way into the cabinets of private collectors, and up to the present
time the species has remained a very rare one. On this account the
acquisition of a good series of skins was among the main objects of
Mr. Stephens’ trip, and the success which rewarded his labors is very
gratifying.
The first specimen was shot April 15 at Cienega Station, where,
during the succeeding three days, six more were obtained. They
frequented large willows along the banks of a stream and, like
Kinglets, spent much of their time searching for food at the extremity
of the branches. Although active and restless, they were not at all
shy. The only note heard here was a sharp “tseep.” On April 18 Mr.
Stephens reached Tucson, where almost the first birds met with were
Lucy’s Warblers. During the early part of his stay they were more
abundant among the mesquites than any other species, and their
“tseeping” could be heard on every side. They were continually in
motion, flying from tree to tree, and occasionally visiting some low
brush in the vicinity. By the 28th their numbers became perceptibly
diminished, but many remained to breed in the surrounding country.
The presence of the species at Camp Lowell is attested by a single
young specimen, barely large enough to fly, which was taken there on
June 1st, but which is unaccompanied by any special remarks. An
adult male from the Santa Rita Mountains, however, comes to me
with the following comments, under date of May 19:—“This is the
only one of the species which I have seen here. It was near the banks
of a stream below the mouth of a cañon, where there were a few
mesquites interspersed among the oaks. I watched it for some time.
It lingered among the mesquites, seeming to prefer them to the oaks,
in which, however, it occasionally alighted for a moment.”
In addition to the above, Mr. Stephens’ notes supply some very
important information regarding the previously doubtful nesting
habits of this species. A female taken April 25, proved on dissection
to be about to lay, but no eggs were actually taken until May 8, when
a full set of five was found near Tucson. After that date many nests
containing either eggs or young were examined. Their sites were
variable; the characteristic place, like that of the specimen
discovered by Captain Bendire, was behind the loosened bark of a
large tree, but use was frequently made of old Woodpeckers’ nests,
knot-holes, and in short all sorts of crevices. A brood of nearly
fledged young (one of which is before me) was actually taken from
the deserted domicile of a Yellow-headed Titmouse, which had been
appropriated by the new tenant without any apparent repairs or
alterations. Among Helminthophilæ this Wren-like mode of
nidification is, I believe, peculiar to this species.
I have the Tucson nest just alluded to. It is composed outwardly of
twigs and weed-stalks; inwardly of hemp-fibres; while there is a
scanty lining of horse-hairs and feathers. Like most hole nests it is
rather flat, and the rim is thin in places where the walls of the cavity
encroached on the space within. The eggs are white, handsomely
wreathed about the larger ends with reddish-brown and umber
spots, a few of which are also scattered over their general surfaces.
They measure respectively .58×.46; .58×.46; .62×.46; .60×.47. The
notes accompanying this set are as follows:—“Nest about six feet
above the ground in a crevice nearly covered by bark. The bottom of
the hole contained an old nest; over this were droppings of wood-
rats, and the whole filled the cavity nearly to its top. The tree (a
mesquite) stood within twenty feet of a frequented road. Female
sitting. Eggs fresh; one had been broken and crowded in behind the
nest by the parent bird.” None of the other sets found by Mr.
Stephens contained more than three eggs and the present clutch is
probably an exceptionally large one.

Juv., first plumage (♀ No. 471, Camp Lowell, June 1).—Wing-coverts and inner
secondaries broadly tipped and edged with pale brownish-fulvous. Primaries and
rectrices edged and tipped with hoary white. Rump and upper tail-coverts
yellowish-chestnut. No chestnut on the crown. Otherwise colored like the adult.
Among a number of adults before me the range of individual variation is very
limited, and is chiefly confined to the females. While it is true that some of the
latter are indistinguishable from the brightest males, the majority have the rump
and crown-patches considerably duller, the chestnut being either diluted in shade,
or mixed with the color of the back. In No. 206 the crown-patch is concealed, the
chestnut being restricted to the basal portion of the feathers.
225, ♂ ad., Tucson, April 18. Length, 4.40; extent, 6.70.
229, ♂ ad., Tucson, April 19. Length, 4.40; extent, 6.80.
231, ♂ ad., Tucson, April 19. Length, 4.40; extent, 7; wing, 2.35; tail, 1.93.
232. ♂ ad., Tucson, April 19. Length, 4.30; extent, 6.80; wing, 2.35; tail, 1.95.
253, ♂ ad., Tucson, April 21. Length, 4.40; extent, 6.70; wing, 2.21; tail, 1.87.
254, ♂ ad., Tucson, April 21. Length, 4.30; extent, 6.70; wing, 2.21; tail, 1.95.
255, ♂ ad., Tucson, April 21. Length, 4.50; extent, 7.10; wing, 2.23; tail, 1.93.
280, ♂ ad., Tucson, April 25. Length, 4.40; extent, 7; wing, 2.25; tail, 1.95.
299, ♂ ad., Tucson, April 28. Length, 4.40; extent, 6.70.
326, ♂ ad., Tucson, May 4. Length, 4.30; extent, 7; wing, 2.20; tail, 1.93.
340, ♂ ad., Tucson, May 7. Length, 4.40; extent, 7; wing, 2.21; tail, 1.93.
410, ♂ ad., Santa Rita Mountains, May 19. Length, 4.10; extent, 6.90; wing, 2.22;
tail, 1.82.
516, ♂ ad., Tucson, June 10. Length, 4.30; extent, 7; wing, 2.12; tail, 1.85.
524, ♂ juv., first plumage, Tucson, June 11. “Taken from nest, which also
contained a young Molothrus ater obscurus.”
197, ♀ ad., Cienega Station, April 15. Length, 4.10; extent, 6.40; wing, 2.12; tail,
1.78. “Iris dark brown; bill black above, bluish beneath; legs black.”
206, ♀ ad., Cienega Station, April 16. Length, 4.40; extent, 6.50; wing, 2.17; tail,
1.80.
208, ♀ ad., Cienega Station, April 16. Length, 4.20; extent, 6.60; wing, 2.09; tail,
1.82.
217, ♀ ad., Cienega Station, April 17. Length, 4.30; extent, 6.70; wing, 2.21; tail,
1.84.
218, ♀ ad., Cienega Station, April 17. Length, 4.10; extent, 6.60; wing, 2.10; tail,
1.85.
228, ♀ ad., Tucson, April 19. Length, 4.30; extent, 6.70; wing, 2.10; tail, 1.85.
230, ♀ ad., Tucson, April 19. Length, 4.30; extent, 6.70; wing, 2.07; tail, 1.84.
256, ♀ ad., Tucson, April 21. Length, 4.20; extent, 6.60.
260, ♀ ad., Tucson. April 22. Length, 4.30; extent, 6.60; wing, 2.08; tail, 1.85.
261, ♀ ad., Tucson, April 22. Length, 4.30; extent, 6.70; wing, 2.25; tail, 1.92.
279, ♀ ad., Tucson, April 25. Length, 4.30; extent, 6.70; wing, 2.10; tail, 1.82.
“About to lay.”
433, ♀ ad., Tucson, May 25. Length, 4.50; extent, 6.50. “With nest and three
eggs; set completed.”
449, ♀ ad., Tucson, May 29. Length, 4.40; extent, 6.90; wing, 2.11; tail, 1.77.
“With nest and three eggs; set completed.”
439, ♀ juv., first plumage, Tucson, May 26. Nearly feathered, but unable to fly.
“Taken from a deserted nest of Auriparus flaviceps.”
471, ♀ juv., first plumage, Camp Lowell, June 1. Length, 4.20; extent, 6.60; wing,
2.10; tail, 1.71. Fully feathered.

32. Helminthophila celata lutescens Ridgw. Western


Orange-crowned Warbler.—A few were seen late in April near
Tucson.
Although not perfectly typical of lutescens, both of the Orange-
crowned Warblers obtained by Mr. Stephens are clearly referable to
that race. They are not quite as yellow beneath as Nicasio (California)
specimens, but they come within a shade of it, and are brighter by
many shades than any of the same sex among my eastern examples;
while in the vividness of the olive-green on the upper parts, they fully
equal any of the California females. The supposed difference in the
tail markings of these races does not hold in the series before me, for
a male from Nicasio has the edging on the inner webs of the rectrices
quite as broad and pure as that of any of the Florida ones. The loss of
this character, however, would be of little consequence, as the two
forms could be readily separated by the wide difference in their
general coloring. Mr. Henshaw considers his Arizona specimens true
celata, and lutescens is now for the first time announced from that
Territory.
290, ♀ ad., Tucson, April 26. Length, 5; extent, 7.30; wing, 2.45;
tail, 2.10. “Iris dark brown; bill black, lighter at base below; legs dark
brown. Not common.”
291, ♀ ad., same locality and date. Length, 4.70; extent, 7.10; wing,
2.37; tail, 2.09. Same remarks.
(To be continued.)
[47]
NOTES ON THE OS PROMINENS.
BY FREDERIC A. LUCAS.

My attention was first directed to this bone by Dr. Shufeldt’s


article in this Bulletin for October, 1881, and subsequently by Mr.
Jeffries’ paper in the number for January, 1882. With the view of
ascertaining in what birds the os prominens is present, and what is
its use, I have since examined quite an extensive series of birds. Lack
of time has prevented as extended an examination as could be
wished for; and as regards discovering any special use for this
sesamoid, it must be confessed that the results of the investigation
are not wholly satisfactory, being rather negative than positive in
their character. But such as they are, they are submitted, in the hope
that they may prove of service to some better skilled physiologist.
Through a lack of good material Dr. Shufeldt failed to discover the
existence of the os prominens in any of the Owls, but it would seem
to be specially characteristic of the Bubonidæ, since it is present in
one particular shape, and with a constant mode of articulation, in the
following species of that family: Ketupa ceylonensis, K. javanensis,
Bubo ignavus, B. bengalensis, B. virginianus, Scops brasilianus, S.
asio, Nyctea scandiaca, Ninox albigulare, Asio otus, Syrnium
nebulosum, and S. uralense. It is not present in Strix flammea or S.
perlata, and should it prove to be present in other genera of the
Bubonidæ than those noted above, it may serve as an additional,
though trivial, point of distinction between the families Bubonidæ
and Strigidæ.
Left wing of Bubo virginianus, from below (reduced one third).
r, radius; u, ulna; c, cuneiform; s, scapho-lunar; os p, os
prominens; epa, tendon of extensor patagii longus.

The accompanying cut, drawn from a fresh specimen of B.


virginianus, explains the form and position of the os prominens.
It will be noticed that it is situated on the anterior surface of the
distal end of the radius, and runs almost parallel with that bone,
instead of standing erect as in the Falconidæ. The radial portion of
the tensor patagii longus terminates in the os prominens, and is not
continued to the first metacarpal.
Apart from the Owls above noted, this bone has been found in
Otogyps calvus, Heterospizias meridionalis, Buteo melanoleucus, B.
pennsylvanicus, B. lineatus, Circus gouldi, Asturina pucherani, and
Haliæetus albicilla.

You might also like