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
com
https://textbookfull.com/product/data-analysis-from-scratch-with-
python-peters-morgan/
textbookfull.com
https://textbookfull.com/product/data-analysis-with-python-and-
pyspark-meap-v07-jonathan-rioux/
textbookfull.com
https://textbookfull.com/product/python-for-data-analysis-data-
wrangling-with-pandas-numpy-and-ipython-wes-mckinney/
textbookfull.com
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
https://textbookfull.com/product/fundamentals-and-applications-of-
supercritical-carbon-dioxide-sco2-based-power-cycles-1st-edition-
klaus-brun/
textbookfull.com
https://textbookfull.com/product/fundamentals-of-software-
engineering-5th-edition-mall/
textbookfull.com
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
Introduction������������������������������������������������������������������������������������������������������������xix
v
Table of Contents
vi
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
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
x
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Table of Contents
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.
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
3. Open the installer (file downloaded in the previous step) and run it.
Please follow the following steps for downloading all the data files used in this book:
Now that we have installed and launched Jupyter, let us understand how to use this
application in the next section.
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.
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.
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
5. Renaming a notebook
Click the default name of the notebook and type a new name, as
shown in Figure 1-6.
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
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
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)
If you are not sure about which keyboard shortcut to use, go to: Help ➤ Keyboard
Shortcuts, as shown in Figure 1-8.
• Shift+Enter to run the code in the current cell and move to the next
cell.
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.
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.
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.
CODE:
print("Hello!")
To print multiple lines of code, we use triple quotes at the beginning and end of the
string, for example:
CODE:
Output:
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.
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.”
75, ♂ ad., Morse’s Mill, March 20. Length, 10; extent, 16.40; wing, 5.38; tail,
4.36. “Iris dark brown.”
6313 (author’s coll.), ♀ ad., San Pedro River, Dec. 25, 1880. Length, 8.90; extent,
12.40.
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.”
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.
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.
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.”
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.
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.”
169, ♀ , near Tombstone, April 6. Length, 4.80; extent, 6.40; wing, 2.10. “Iris
dark brown. Shot among low brush. Not common.”
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.
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.