100% found this document useful (1 vote)
6 views

Learn Data Analysis with Python: Lessons in Coding First Edition A.J. Henley instant download

The document provides information about the book 'Learn Data Analysis with Python' by A.J. Henley and Dave Wolf, including its content structure and chapters focused on data analysis techniques using Python. It also includes links to various related eBooks and resources for further learning. The book emphasizes practical exercises and the use of Jupyter Notebook for coding in Python.

Uploaded by

kimpeesherna66
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
6 views

Learn Data Analysis with Python: Lessons in Coding First Edition A.J. Henley instant download

The document provides information about the book 'Learn Data Analysis with Python' by A.J. Henley and Dave Wolf, including its content structure and chapters focused on data analysis techniques using Python. It also includes links to various related eBooks and resources for further learning. The book emphasizes practical exercises and the use of Jupyter Notebook for coding in Python.

Uploaded by

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

Learn Data Analysis with Python: Lessons in

Coding First Edition A.J. Henley download

https://ebookmeta.com/product/learn-data-analysis-with-python-
lessons-in-coding-first-edition-a-j-henley/

Download more ebook from https://ebookmeta.com


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

Learn Python By Coding Video Games Intermediate A step


by step guide to coding in Python fast Patrick Felicia

https://ebookmeta.com/product/learn-python-by-coding-video-games-
intermediate-a-step-by-step-guide-to-coding-in-python-fast-
patrick-felicia/

Tiny Python Projects Learn coding and testing with


puzzles and games 1st Edition Ken Youens Clark

https://ebookmeta.com/product/tiny-python-projects-learn-coding-
and-testing-with-puzzles-and-games-1st-edition-ken-youens-clark/

Learn Python by Coding Video Games Beginner 1st Edition


Patrick Felicia

https://ebookmeta.com/product/learn-python-by-coding-video-games-
beginner-1st-edition-patrick-felicia/

Emerging Threats of Synthetic Biology and


Biotechnology: Addressing Security and Resilience
Issues (NATO Science for Peace and Security Series C:
Environmental Security) Benjamin D. Trump
https://ebookmeta.com/product/emerging-threats-of-synthetic-
biology-and-biotechnology-addressing-security-and-resilience-
issues-nato-science-for-peace-and-security-series-c-
Figures of Natality Reading the Political in the Age of
Goethe 1st Edition Joseph D. O’Neil

https://ebookmeta.com/product/figures-of-natality-reading-the-
political-in-the-age-of-goethe-1st-edition-joseph-d-oneil/

DK Eyewitness Madrid Travel Guide Dk Eyewitness

https://ebookmeta.com/product/dk-eyewitness-madrid-travel-guide-
dk-eyewitness/

Clinical Dermatology 5th Edition Richard B Weller


Hamish J A Hunter Margaret W Mann

https://ebookmeta.com/product/clinical-dermatology-5th-edition-
richard-b-weller-hamish-j-a-hunter-margaret-w-mann/

The Lost Child Complex in Australian Film Jung Story


and Playing Beneath the Past 1st Edition Terrie Waddell

https://ebookmeta.com/product/the-lost-child-complex-in-
australian-film-jung-story-and-playing-beneath-the-past-1st-
edition-terrie-waddell-2/

Sons of Abraham vol 2 Pawns of Terror 1st Edition


Joseph Ray

https://ebookmeta.com/product/sons-of-abraham-vol-2-pawns-of-
terror-1st-edition-joseph-ray/
An Analysis of Robert E Lucas Jr s Why Doesn t Capital
Flow from Rich to Poor Countries 1st Edition Padraig
Belton

https://ebookmeta.com/product/an-analysis-of-robert-e-lucas-jr-s-
why-doesn-t-capital-flow-from-rich-to-poor-countries-1st-edition-
padraig-belton/
A. J. Henley and Dave Wolf

Learn Data Analysis with Python


Lessons in Coding
A. J. Henley
Washington, D.C., District of Columbia, USA

Dave Wolf
Sterling Business Advantage, LLC, Adamstown, Maryland, USA

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/​9781484234853 . For
more detailed information, please visit http://​www.​apress.​com/​
source-code .

ISBN 978-1-4842-3485-3 e-ISBN 978-1-4842-3486-0


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

Library of Congress Control Number: 2018933537

© A.J. Henley and Dave Wolf 2018

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.

Printed on acid-free paper

Distributed to the book trade worldwide by Springer


Science+Business Media New York, 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
email orders-ny@springer-sbm.com, or visit
www.springeronline.com. Apress Media, LLC is a California LLC and
the sole member (owner) is Springer Science + Business Media
Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
Table of Contents
Chapter 1:​How to Use This Book

Installing Jupyter Notebook

What Is Jupyter Notebook?​

What Is Anaconda?​

Getting Started

Getting the Datasets for the Workbook’s Exercises

Chapter 2:​Getting Data Into and Out of Python

Loading Data from CSV Files

Your Turn

Saving Data to CSV

Your Turn

Loading Data from Excel Files

Your Turn

Saving Data to Excel Files

Your Turn

Combining Data from Multiple Excel Files

Your Turn

Loading Data from SQL


Your Turn

Saving Data to SQL

Your Turn

Random Numbers and Creating Random Data

Your Turn

Chapter 3:​Preparing Data Is Half the Battle

Cleaning Data

Calculating and Removing Outliers

Missing Data in Pandas Dataframes

Filtering Inappropriate Values

Finding Duplicate Rows

Removing Punctuation from Column Contents

Removing Whitespace from Column Contents

Standardizing Dates

Standardizing Text like SSNs, Phone Numbers, and Zip


Codes

Creating New Variables

Binning Data

Applying Functions to Groups, Bins, and Columns

Ranking Rows of Data


Create a Column Based on a Conditional

Making New Columns Using Functions

Converting String Categories to Numeric Variables

Organizing the Data

Removing and Adding Columns

Selecting Columns

Change Column Name

Setting Column Names to Lower Case

Finding Matching Rows

Filter Rows Based on Conditions

Selecting Rows Based on Conditions

Random Sampling Dataframe

Chapter 4:​Finding the Meaning

Computing Aggregate Statistics

Your Turn

Computing Aggregate Statistics on Matching Rows

Your Turn

Sorting Data

Your Turn

Correlation
Your Turn

Regression

Your Turn

Regression without Intercept

Your Turn

Basic Pivot Table

Your Turn

Chapter 5:​Visualizing Data

Data Quality Report

Your Turn

Graph a Dataset:​Line Plot

Your Turn

Graph a Dataset:​Bar Plot

Your Turn

Graph a Dataset:​Box Plot

Your Turn

Graph a Dataset:​Histogram

Your Turn

Graph a Dataset:​Pie Chart

Your Turn
Graph a Dataset:​Scatter Plot

Your Turn

Chapter 6:​Practice Problems

Analysis Exercise 1

Analysis Exercise 2

Analysis Exercise 3

Analysis Exercise 4

Analysis Project

Required Deliverables

Index
About the Authors and About the
Technical Reviewer
About the Authors
A. J. Henley

is a technology educator with over 20 years’


experience as a developer, designer, and
systems engineer. He is an instructor at both
Howard University and Montgomery College.

Dave Wolf

is a certified Project Management


Professional (PMP) with over 20 years’
experience as a software developer, analyst,
and trainer. His latest projects include
collaboratively developing training materials
and programming bootcamps for Java and
Python.
About the Technical Reviewer
Michael Thomas

has worked in software development for


more than 20 years as an individual
contributor, team lead, program manager,
and vice president of engineering. Michael
has more than ten years of experience
working with mobile devices. His current
focus is in the medical sector, using mobile
devices to accelerate information transfer
between patients and health-care providers.
© A.J. Henley and Dave Wolf 2018
A.J. Henley and Dave Wolf, Learn Data Analysis with Python,
https://doi.org/10.1007/978-1-4842-3486-0_1

1. How to Use This Book


A. J. Henley1 and Dave Wolf2
(1) Washington, D.C., District of Columbia, USA
(2) Sterling Business Advantage, LLC, Adamstown, Maryland, USA

If you are already using Python for data analysis, just browse this
book’s table of contents. You will probably find a bunch of things
that you wish you knew how to do in Python. If so, feel free to turn
directly to that chapter and get to work. Each lesson is, as much as
possible, self-contained.

Be warned! This book is more a workbook than a textbook.

If you aren’t using Python for data analysis, begin at the


beginning. If you work your way through the whole workbook, you
should have a better of idea of how to use Python for data analysis
when you are done.
If you know nothing at all about data analysis, this workbook
might not be the place to start. However, give it a try and see how it
works for you.

Installing Jupyter Notebook


The fastest way to install and use Python is to do what you already
know how to do, and you know how to use your browser. Why not
use Jupyter Notebook?

What Is Jupyter Notebook?


Jupyter Notebook is an interactive Python shell that runs in your
browser. When installed through Anaconda, it is easy to quickly set
up a Python development environment. Since it’s easy to set up and
easy to run, it will be easy to learn Python.
Jupyter Notebook turns your browser into a Python development
environment. The only thing you have to install is Anaconda. In
essence, it allows you to enter a few lines of Python code, press
CTRL+Enter, and execute the code. You enter the code in cells and
then run the currently selected cell. There are also options to run all
the cells in your notebook. This is useful if you are developing a
larger program.

What Is Anaconda?
Anaconda is the easiest way to ensure that you don’t spend all day
installing Jupyter. Simply download the Anaconda package and run
the installer. The Anaconda software package contains everything
you need to create a Python development environment. Anaconda
comes in two versions—one for Python 2.7 and one for Python 3.x.
For the purposes of this guide, install the one for Python 2.7.
Anaconda is an open source data-science platform. It contains
over 100 packages for use with Python, R, and Scala. You can
download and install Anaconda quickly with minimal effort. Once
installed, you can update the packages or Python version or create
environments for different projects.

Getting Started
1. Download and install Anaconda at
https://www.anaconda.com/download .

2. Once you’ve installed Anaconda, you’re ready to create your first


notebook. Run the Jupyter Notebook application that was
installed as part of Anaconda.

3. Your browser will open to the following address:


http://localhost:8888. If you’re running Internet
Explorer, close it. Use Firefox or Chrome for best results. From
there, browse to http://localhost:8888.

4. Start a new notebook. On the right-hand side of the browser,


click the drop-down button that says "New" and select Python or
Python 2.

5. This will open a new iPython notebook in another browser tab.


You can have many notebooks open in many tabs.

6. Jupyter Notebook contains cells. You can type Python code in


each cell. To get started (for Python 2.7), type print "Hello,
World!" in the first cell and hit CTRL+Enter. If you’re using
Python 3.5, then the command is print("Hello, World!").

Getting the Datasets for the Workbook’s Exercises


1. Download the dataset files from
http://www.ajhenley.com/dwnld .

2. Upload the file datasets.zip to Anaconda in the same folder


as your notebook.

3. Run the Python code in Listing 1-1 to unzip the datasets.

path_to_zip_file = "datasets.zip"
directory_to_extract_to = ""
import zipfile
zip_ref = zipfile.ZipFile(path_to_zip_file, 'r')
zip_ref.extractall(directory_to_extract_to)
zip_ref.close()

Listing 1-1 Unzipping dataset.zip


Another Random Scribd Document
with Unrelated Content
convictions and emotions who does not cherish with affection the
name of Father Moore.
Some Sundays afterwards he had occasion to read the following
epistle:—
“Be you humbled under the mighty hand of God, that He
may exalt you in the time of visitation. Casting all your
care upon Him, for He hath care of you. Be sober and
watch; for your adversary the devil, as a roaring lion
goeth about, seeking whom he may devour; whom resist
ye, strong in faith....”
As he did so, his eye travelled over to me; and the following day he
came over to me.
“I know what you are going to say. You make me watchful of my
epistles,” he said.
XV.
Deadened and inert though the barbarity of solitary confinement
caused one to become (and even as solitary confinement ours was
particularly severe and therefore particularly barbarous) there were
times when the whole being rose in revolt. Anything would have
been preferable to it. On one such occasion I demanded to see the
Commandant of the jail. When he came, I requested to know exactly
why I was being punished, and for what offence. I told him that I
wished to have his answer in writing and to be able to communicate
with my solicitor with a view to taking action. My thought was that a
personal suit against him might prove abortive, but that it might
cause a publicity the effect of which would be healthy.
He replied that I was not being punished; that I was simply being
“detained.” I said that this could not be. According to prison
regulations, solitary confinement of so severe a nature was
punishment at least equivalent to birching. Would he birch me
without acquainting me with the cause of such a punishment? No,
he said, he would not. Then why, I asked, was I receiving a
punishment equivalent in severity without a cause assigned. I
wished to be provided with a cause, and to be provided with it in
writing.
The Commandant himself was gentlemanly and courteous. A few
days afterwards when I repeated my request he told me he was
simply acting under orders, and that he could not change matters
without orders. I asked him then if he would communicate my
request to the War Office, under whose instructions he proceeded;
and he promised to do so.
Some time elapsed; and when he spoke to me further about the
matter he asked what it was that I demanded. He asked me if I
would particularise. I replied that the War Office had on their own
initiative defined us as Prisoners of War. It had been announced to
us that all our letters had to be so addressed; all the orders given to
us were made applicable under that heading. I said I did not quarrel
with the designation; both nationally and personally I hailed it. It
was, I agreed, a splendid designation; but such being our state, I
demanded on our behalf the application of the international
agreement governing the treatment of prisoners of war—an
agreement that, I believed, had been ratified between the
belligerent powers during the first week of the war. In other words, I
wanted tobacco and pipe, I wished any books that I might order or
that might be sent in to me, daily papers, free communication with
my fellow-prisoners, and the opening of cell doors by night and by
day, the right to have food sent into us, and the return of my money
in order that I might be able to purchase food in the town, and
facilities to purchase it, by canteen or by order. I added that what I
demanded I demanded not for myself but for all of us, and in all of
the prisons.
After a few days he came to me to say that the War Office had
authorised him to grant these rights, but to grant them in stages,
and with one stipulation. That stipulation he would announce to the
men. Having put us all on parade he announced the rights that
would be granted, but said that it would first be necessary for us to
choose a commandant from among ourselves who would be
responsible to him for the good order of the prison, and who would
have power to maintain discipline. The men appointed me, and I
created officers for each of the landings.
So began our little republic, and so extended our educative
influence. When the rights were in full force the staff became
supernumeraries. We created our post office and handled our own
parcels and letters for distribution. Rules were laid down for the
ordering of our life together; and only once or twice was it necessary
to take disciplinary measures (solitary confinement in one case as a
pathetic reminder!), for the general spirit of loyalty and affection was
sufficient—was, in fact, remarkable with a body of men not
accustomed to the strict rules necessary to the ordering of such a
community. The appointed officers were responsible for their
landings, made daily reports, and brought up any cases with which
they were unable to deal. And so from top to bottom we maintained
ourselves, quietly eliminating the staff, to the no small dissatisfaction
of some of them, though with the good will of most. There was, in
fact, no work for most of the staff to do.
At seven each morning, after breakfast, and at eight at night, the
bell was rung, and we all gathered for public prayers. Michael
MacRory Irish orator, and Padraic Pearse’s gardener, led the Rosary.
Englishmen speak much of our religious differences. It devolved
upon me as a Protestant to summon the prayers, and none thought
otherwise of it than as a natural thing, while every Protestant knelt
with his fellows in prayer to the one God. Whatever announcements
or enquiries Father Moore had to make were made through a
Protestant, and had anyone suggested that they should not have
been so made, it would have fared ill with him. They were made as
a simple matter of authority by whoever was in authority. The
reason for this was that we were sufficient in ourselves to guard
over our own affairs without a stranger’s hand to create trouble.
These daily prayers were a great astonishment to the staff. One
sergeant declared to a visitor: “I heard a lot about these Sinn
Feiners being a bad lot, but you should see them. They’re a religious
lot. They goes to prayers and church same as we goes to the
theaytre.” And when, some days after our public prayers had begun,
the news came that the “Hampshire” had sunk, there was not a man
of the staff but was fully assured that it was our prayers had sent
Lord Kitchener to his death.
At ten each night every man was required to be off the corridor and
balconies, and any conversation in cells after that time had to be
conducted softly, in order not to interfere with those who wished to
sleep; and within five minutes of the ringing of the bell the prison
was clear and quiet. The staff became accustomed, if they had
business to execute with us, to resign it into our hands for
prosecution. Those who did not do so made a sad affair of their
undertaking. Which is a parable. In a phrase, our motto was:

It was interesting to notice our influence on the staff. We never


troubled about them; they had their interests and we had ours; and
only occasionally the national opposition clashed sharply. Yet they
confided in us. With our extended rights the library was opened to
us; and the librarian-warder informed us that he was at first afraid to
be left alone in the library with any one of us. Apparently he thought
we would bite out his windpipe unexpectedly, or playfully split his
skull. But when his first visitor, a man from Belfast, contemptuously
described his collection of books as “piffle,” and asked that certain
other books should be procured from the officers’ library, as he
himself declared: “My word, I was surprised. I thought you Sinn
Feiners were a wild lot of savages from what I heard of you. But you
are men of culture, most of you. It’s a bit of a shock to a man to find
out.” The librarian-warder was quite pleased at the widening range
of his ethnographical knowledge.
Yet the most interesting member of the staff was the sergeant of the
R.A.M.C. He was a Doctor of Literature at Oxford, and also, I
believe, a Docteur ès Lettres at the Sorbonne. He had been out at
Gallipoli, whence he had been invalided home. As he passed on his
rounds he would often come into my cell for a talk. We very seldom
spoke on national questions, for I assumed that our orbits of interest
on such matters would not cut each other at any point; our
conversation was generally on literary or philosophical matters. But
once he came up to me with a definite thing to say.
“You know,” he said, “the Government make a great mistake putting
men like you into prison. You will never forget it; you can never
forget it; no man could who canvasses experience with his intellect.
They’re simply a lot of grandfatherly old fools at the top of affairs,
and we always make a muddle of things. They should either give
you a clear run, and let you make what you can of your country and
take the chances; or they should wait their chance and shoot you
out of hand and laugh at the racket afterwards. But all this
sentimental talk about your country, followed up by all this muddle,
simply makes a thinking man sick. All this business,” and he
indicated the hundreds of us standing talking about the yard, “is
clumsy, it’s idiocy, and it breeds more clumsiness and idiocy for the
future.”
“Which of your two alternatives would you adopt?” I asked him.
“Well, you know, one likes to meet a man to whom one can talk;
intellect, and all that sort of thing, and culture, and care for art,
they’re rare enough in this world, and one wouldn’t altogether care
to take the responsibility of destroying any part of it—”
“But you’d shoot me all the same.”
“Yes, I think I would.” He was quite serious. “Quite possibly that’s
because I’ve just been seeing a lot of blood; and I don’t think I
would have said that two years ago. But just now I’d shoot you. I
wouldn’t of course do it in a stupid way. I’d wait till you gave me a
chance; and sooner or later you would, for you have your
convictions, and they’d lead you into my hand; and then I’d shoot
you instantly, and without trial if need be, without waiting anyhow.
Of course there’d be trouble afterwards, but I’d wait quietly till that
blew over, as it would.”
“That wouldn’t get you out of the wood, for you’d make a martyr of
me and exploit my ideals.”
“That’s so. There’s that side, of course. But still that’s what I think
I’d do. I certainly wouldn’t go muddling about trying to do two
mutually contradictory things at the same time. All you men here—
the whole thing’s simply offensive.”
“Does the hypocrisy offend you then? You ought to have become
accustomed to that by this time as a nation.”
“Well, yes, in a way it does, I suppose. But it’s not that mainly; it’s
the clumsy thinking; it’s not thinking the thing out from the
beginning. Do I horrify you?”
“Not at all. If you came over to Ireland you’d have a great audience.
We’d agree with you in every word, simply and utterly. We’d be
delighted to meet one of your nation who looked at things without
any silly sentiment. You’re a sentimental people, and at bottom very
cruel; we’re not sentimental. You are as sentimental as any yourself;
but you’ve at least got your mentality clear of it, and so for the first
time you can see things as they are. The worst of it is that, dealing
with a sentimental people, you are making us superficially
sentimental too, and that’s distracting us from our work. I only wish
that more of you would talk as you do, instead of slobbering. And
shoot away; as long as you say why, without using words that
convey nothing to us and that only mean sloppy thinking on your
part.”
“But I thought you objected to the shootings in Dublin.”
“Certainly. Those men were my brothers. But they weren’t shot as
you said you’d shoot me, because you were out to smash an
opposed thing as the only logical alternative to giving it the run of its
own life, but, if you please, because they didn’t accept certain
standards which none of us can ever accept until we make and
endorse them in terms of ourselves—or, rather, which we now do
and must for ever act upon in that sense, because it’s the first
principle of life so to do. And then, when you have them shot, you
turn round and praise their noble ideals! In the name of heaven,
what ideals?”
“I think I should certainly shoot you now.”
“To smash me. Good man! We’d understand that in Ireland, where
your Liberal sentiments bore us, and your Tory hectoring irritates us.
We’re a kindly people—human and hospitable; but you, because you
can escape into words and hide realities from yourselves, are cruel
and inhospitable.”
And I believe he would have shot me. Many were the conversations
we had; many were the kindly, thoughtful acts he did for us; and he
was courtesy itself to the ladies who spent their days at the prison
gate taking rebuffs from everyone in the prison, in the determination
to see that each man of us received what he had need of, food or
clothing. But he would have reasoned the thing out and shot me,
without the least ill-will or high-falutin. And I would have borne him
no ill-will, for the fight would have continued long past the two of
us.
XVI.
These more fortunate times soon came to an end—for me at least.
So long as they lasted they were not intolerable; and the various
funds in aid of prisoners, and the companies of our fellow-
countrymen and women (chiefly women!) who came to visit us,
made captivity as amenable as it could be made. But one morning I
was summoned to the Commandant’s office, and informed that I and
some fifty others were to be sent that day to an internment camp at
Frongoch in Wales. We were to be the first to arrive, and we were to
take charge of the camp and order and regulate it for the remainder
of the Irish Prisoners of War, who would arrive in detachments from
Stafford, from Knutsford, from Perth, from Glasgow, from Wakefield,
from Wandsworth, and from Lewes.
Such were the orders, and we were to be ready to leave in an hour’s
time. But I had what H. P. afterwards chaffingly alluded to as my
“strategic illness.” Never till then did I admire the amazing insight
and foresight of Dublin Castle.

I was in fact covered from head to foot with the proof of their
perspicuity. And as a result all the detachments to Frongoch from
Stafford were held back for three weeks to cover the period of
infection.
Thus I spent nearly a fortnight in hospital in the company of an
R.A.M.C. corporal who was isolated with me. He had been a
Northumberland mines inspector, and we discussed the working of
mines, their proprietorship and profits, and the virtues of Trades
Unions. Sometimes my friend the sergeant came and stood out of
sight, and beyond infection, behind the door. He informed me that it
had been discovered that I had written a book on Shakespeare, and
that I was to be treated with respect accordingly. He seemed to be
somewhat amused at this. But my corporal snorted with northern
scorn, and declared that if I could not be treated with respect as a
man, I should not be treated with respect as a man who had written
books. So, with one hand, one touched both ends of English society.
When I rose I was informed by the Commandant that I was not to
rejoin the others. Since I had been ill, it appeared, instructions had
been received that I and another were to be isolated. That other (H.
P.) was already in a cell in the Crescent, where I was to be taken. He
and I would be allowed to speak to one another whenever the staff
arrangements permitted of it; but never, under any circumstances,
were we to be allowed to communicate with the others. And, at the
same time, he handed me my official order of internment, stating
that according to regulations drafted for dealing with “aliens,” I was
to be interned because I was “reasonably suspected of having
favoured, promoted or assisted an armed insurrection against His
Majesty.”
It was easy to see a craftier hand than that of the War Office at
work in this. Yet, by isolating us they magnified us: a result, indeed,
that the smallest wit could have foreseen. We were exercised
together in the afternoon; and when, the first day, we passed within
sight of the others they hailed us unitedly from the distance.
Thereafter we were not permitted to pass within sight of them.
The rooms into which we had been put had been designed for
consumptive prisoners, and contained bracket beds attached to the
wall. The walls were plastered and smooth, and painted in a pleasing
combination of two greens. Little things; but what they meant to
anyone who had to spend his day sitting in a small cell! What chiefly
delighted me, however, was the blanket on my bed. It would have
given joy to a Red Indian chief. Its colours were green, claret, and
yellow. It lay on my bed like a spread cockatoo. Life could not be
drab with that to look upon. Moreover, I had books, and I was
allowed foolscap on which to write. So with books, pen and blanket,
the days passed with as much ease as a prison could give. For,
strangely enough, though the severity of our condition had been
much relaxed, the presence and the effect of the system remained.
Books that demanded any thought in the reading were avoided; the
mind seemed incapable of the effort they demanded; as soon as a
page were read it passed from the memory, and the mind became
once again a blank. One rebelled against this at first, and sought to
conquer it; but when the will demanded an effort, the brain replied
that such efforts were for another, not for this world, that the soul
could not realise itself in a world that had been wrought as nearly as
possible to resemble a vacuum.
A sergeant had been placed in charge of the two of us, a grown
child of a man, with all a child’s shrewdness and sharpness, and
from him we received many friendly acts in spite of the fact that he
seemed constantly to live in fear of some judgment that would alight
on him. He would take me into H. P.’s cell for conversation, and he
came to the tolling of the gong without a murmur or complaint. And
for twenty minutes each day I saw my wife at the iron gate—who, in
truth, lived her days at that gate.
Then one day Father Moore came into my room and sat on my bed,
with the tears in his eyes. “They’re taking the men away from me,”
he said. The dear man was heart-sore at the parting that now
began. Every few days saw the men leaving in batches of fifty to a
hundred on their way to Frongoch. Sometimes from a distance we
could see them going. More often we had to rely on news brought
us from our sergeant. The final stage of our journey was to begin;
for we nothing doubted that our destination was to be the same as
theirs—Frongoch, from which place no good reports came.
It was not till they had all gone, and we had had the long desolate
prison to ourselves for over a week that we were informed that we
were not to go to Frongoch, but were to be removed to Reading Jail.
The others having gone, and the fear of our contamination removed,
we had been permitted the run of the prison; and quite probably we
were the only prisoners in all time who paced alone a long prison
that echoed to our steps. The effluence of many thousands of
prisoners was about us; and we entered the cells to find the names
they had scratched and to reconstruct their history.
Then one morning, July 10th, we were marched out under yet
another sergeant’s guard for Reading Jail.
XVIII.
Reading Jail that day was a mustering of the clans. All the isolation
men from the various prisons, Wakefield, Knutsford, and
Wandsworth, including many who had been to Frongoch, were
gathered together at Reading. It was meant as an elect company;
but it was not at all as elect as the selectors imagined. We ourselves
entertained no delusions on that head. One of the most
distinguished of our company had been wildly hailed on his arrival
months before at Wandsworth, as the man who “’ad been a-hinciting
of ’em”; and apparently the net had been thrown to sweep into
Reading all those who “’ad been a-hinciting of ’em”; but the net had
had a singularly faulty mesh. Even the original net that had swept
through the country during the month of May, carefully though it
had been wrought, and thoroughly though it had been cast, had had
a mesh none too perfect. There were but twenty-eight of us
gathered together that day; and we had, as it were, a double crown
pressed on our heads; but we made haste to disown the title to
wear it.
Yet we were glad to meet. National work necessarily intersects at
many points, and so most of us who foregathered that day for our
months of association had met before in differing combinations, and
at different times, in differing groups of work that were but part of
the one great work. Yet we had never met in that particular
combination before. Some came representing the leadership of large
districts, counties or cities, and some represented national
leadership from some more central focus. The provinces were indeed
as nearly represented as they could well be: eight came from
Connacht, seven from Leinster, seven from Munster, and six from
Ulster; or, fourteen from Leth Chuinn and fourteen from Leth
Mhogha. It was exceedingly well arranged. Though we were not as
complete as we might have been, though we did not venture to
conceive of ourselves as an assembly either inclusive or exclusive of
anything, yet the general representation was very evenly matched.
And it was yet more evenly when, two days later, another Ulster
representative arrived; for, as it so fell out, a Connacht man had
been elected as Ceannphort, and so the provinces were left matched
with a perfect seven apiece.
Such was the skill the Government of England had taken to see, not
only that we had an opportunity of meeting and understanding one
another such as we never could have hoped for, but that we should
meet as a well-balanced and proportionate whole. The care with
which this was wrought must have been considerable.
The only drawback to our assembly was the uncertainty of date
when we discontinue it, and the building in which we met.
XVIII.
Reading, being set deep in a valley at the confluence of two rivers, is
an unhealthy town, close and sultry by summer, and damp and misty
by winter. The gaol is a handsome building, erected in red brick after
the manner of an old castle, with battlements and towers. One
almost expected a portcullis to be lowered at the great gate; and
when we were within the double gates we certainly felt as though a
portcullis had been drawn after us. We stood in a small cobbled
yard. Behind us was the broad wall in which the double gates were
set, flanked on each side by the Governor’s and the Steward’s
houses. Before us a flight of stone steps arose, leading to the
offices, behind which was the large male prison. To the right a wall
arose dividing us from the work yard; and on the left a high blind
wall arose, pierced only by a single door near the wall round the jail.
This was the female prison—ordinarily so, but for the time being our
habitation.
Yet what astonished me most was the sight of flowers. Their
presence made the cobbled yard and the precincts seem almost
collegiate. In neatly kept beds about the walls they lifted their heads
with a happy gaiety very strange to some of us who had known so
human a touch banished from buildings more appropriately given
over to the possession of flints and cinders. A few days after we
were taken through the work yard behind the main prison. Here in
the work hall a canteen was opened on three days in the week for
the interned prisoners who now occupied the prison, but here also
was the large exercise yard, and it was covered with an abundance
of flowers. The familiar asphalt paths could not be seen where they
threaded their way amid blossoms. In beds beneath the walls tall
flowers lifted their heads, and even the graves of hanged men could
not be seen beneath the blooms that covered them.
It was an amazing sight. There were not merely flowers, a sight
astonishing enough in itself; there was a prodigality of flowers. Then
some of us remembered the cause. One of the graves unlocked the
secret. It was marked with the letters C. T. W., and the date, 1896,
to whom Oscar Wilde’s “Ballad of Reading Jail” had been inscribed,
and in celebration of whose passing the poem had been penned.
But neither milk-white rose nor red
May bloom in prison-air;
The shard, the pebble, and the flint
Are what they give us there:
For flowers have been known to heal
A common man’s despair.

So never will wine-red rose or white


Petal by petal, fall
On that stretch of mud and sand that lies
By the hideous prison-wall,
To tell the men who tramp the yard
That God’s Son died for all.
So Wilde had sung, not in protest, but in bitter acceptance, never
dreaming that a poet’s song could change the flint, the pebble, and
the shard of the yard he trod. But for us who came after him with
the memory of his song in our minds, the miracle had been wrought.
Miracle it was, and it had been wrought in no common sort, for the
great yard was a lake of leaf and bloom, and the hideous prison wall
was transformed by gay figures decked in raiment that not Solomon
in all his glory could outvie.
Already in the pebbled entrance yard the hand of this
“unacknowledged legislator” was in evidence. We were first taken
across to the office, as we arrived in batches, and our money taken
from us, and our kit examined. Then we were led back through the
door in the blind wall into the female prison, that had been allocated
to Irish Prisoners of War. The main prison was occupied by the
nations of Europe: Belgians, Germans, French, Rumanians, Russians,
and indeed every degree and variety of European to the number of
fourteen.

The prison actually held only twenty-two cells. There were in


addition a hospital, a maternity ward, and two padded cells, one
permanent and one temporary. The hospital and maternity ward
consisted of two cells each, with the intervening wall removed. In
each of these three men were placed (there being some little rivalry
for the maternity ward), which with the use of the temporary
padded cell provided for all of us. In addition to this, there was also
an observation ward, on the ground floor, similarly constructed of
two cells converted into one, and this was given to us as a
recreation room. All these cells were on one side of the building, the
other side being a blank wall, and the only light that came to the
passage struggled down through skylights.
Such was the place that was to be our habitation for nearly six
months, and in which we erected the structure of our communal life.
XIX.
We had all come with experience of prison life, and were not easily
perturbed. We had become accustomed to taking things as we found
them, and making them the basis of improvement, not in the mood
of those who sought privileges, but as those who demanded rights.
Our first act was to elect a Ceann-Phort, through whom to formulate
our demands, and by whom to lay out the lines of our life together.
Our next act was to put together the tables that stood in the
passage in order that we might have our meals together. From the
very first during the time we were permitted together we at once
took the control of our affairs into our own hands, and it became a
recognised principle that any dealings of officials with us were with
us as a whole and not with individuals.
For instance, the prison had to be scrubbed through twice a week,
and in addition there was orderly work to be appointed, such as
daily sweeping, polishing of rails, cleaning of dishes, and, as we had
elected to take our meals together, the preparation and clearance of
tables. For this work it was proposed, as in the usual way, to select
the required men, and to pay them at the prison rate of ten pence a
day. Instead of that we desired that the payment should be made to
the Ceann-Phort, saying that the work would be done under his
arrangements. We were then drawn out into eight teams who took it
in turns for orderly work. The fatigues on Wednesday and Saturday
were taken by each half-company of four teams. All questions
concerning our life were arranged between our Ceann-Phort and the
prison Governor.
The moneys that were paid over to us were expended by us,
together with contributions made from time to time from among us,
on the canteen that was open three days in the week. For the food
that we received was the same as we had received in other prisons,
except that at first its quality was improved. While our exchequers
lasted we were able to enrich our dietary to some extent by extra
doles of bread, margarine and sugar. This canteen was in the hands
of one of the grocers in the town for the use of all the prisoners in
the jail.
The first night we were locked up at eight o’clock, with lights out at
nine. This was one of the first matters to which we turned our
attention. We were not successful in approximating this to the
conditions that had prevailed elsewhere with us, such as at Stafford,
but we were finally able to have the time altered to ten. The gravest
hardships, however, in the conditions as at first announced to us
were that we were only suffered one visit every three months and
one letter each month. These were the ordinary conditions imposed
on penal servitude convicts,

Finally we were permitted one visit a month and two letters each
week, the letters to be written on little slips of paper provided for us.
At first also we were refused the right to receive parcels of food sent
in by friends. This was clearly contrary to the code prevailing for
Prisoners ...; and this also we had annulled.
Therefore our life, as finally adjusted, was on this wise. We were
aroused at seven o’clock, and the orderlies for the day at once laid
the breakfast, which was taken at a quarter to eight. At half-past ten
we were taken out by the warders to the work yard for exercise.
There we disported ourselves as we pleased until we were brought
in for dinner at twelve. In the afternoon we went out, not to the
work yard, but to the small exercise yard at the back of our prison.
This was separated by a wall from the Debtors’ Yard, of which Wilde
had sung:
In Debtors’ Yard the stones are hard,
And the dripping wall is high.
Then tea at five—
And the bitter bread they weigh in scales
Is full of chalk and lime.
After tea, during the summer months, we were allowed out into the
yard again till it was dark, and at ten the key grated against us once
more in our cell doors.
Each narrow cell in which we dwell
Is a foul and dark latrine,
And the fetid breath of living death
Chokes up each grated screen,
And all, but Lust, is turned to dust
In Humanity’s machine.
XX.
We were treading a path that had already been sung (for even
bitterness has its song) but we trod it in greater comfort. Above all
we had one another’s company. The boon of this might conceivably
have been blurred a little, as with the passage of months it became
difficult in our cramped space to avoid treading on one another’s
toes. And certainly it was impossible for each man not to know each
other at his best and worst. The knowledge so gained had its value
for future days. For at bottom the solidity with which we began was
only cemented with the passage of time.
Yet our company was first to be revised, by a process of addition
and subtraction, before it took its final shape. One Friday in August
we were informed that on the Monday and Tuesday following we
were to be taken in two parties before the Advisory Committee. We
were asked to give our word that we would make no attempt to
escape. If we gave that pledge we would be sent to London with
warders in plain clothes; otherwise it would be necessary to send us
handcuffed together. On this a keen discussion took place; for while
the majority was content to give the undertaking there were some
who would give no pledge, who would leave it to the authorities to
decide for themselves on any action they pleased. Finally the
Governor, who was very anxious to avoid handcuffs, assumed an
undertaking, and so the issue was muffled. Two warders in plain
clothes accompanied each party to Wormwood Scrubbs Jail; and
nothing was done to advertise the fact that we were prisoners
travelling. Had the question arisen a few months later hardly a man
would have given the undertaking, or even have suffered it to be
implied. The public display of handcuffs would have been coveted
rather than avoided; for it was certainly not to comfort us that the
offer was made, whatever the Governor’s personal inclinations might
have been. For jails but straighten the back and harden the mind.
We also differed in our attitude towards the Advisory Committee.
None of us differed in our opinion of its function. It sat, so the
purport ran, to decide which of us might be liberated; or rather,
more technically, in respect of which of us our internment orders
should be confirmed; but these things, as we know, would be
decided by political considerations quite outside the review of the
Committee. None of us doubted that its main function was to check
and complete our Leabhrain, as far as possible, by question and
cross reference. But we differed in our attitude. Some refused to
recognise the Committee in any way, as being a body set up by a
foreign government, having no authority over Irishmen. These, when
brought before the Committee, firmly defined their attitude, and
were promptly escorted again into the outside air. Others answered
the brief interrogatory to which they were submitted, and went their
way in a matter of minutes. My own attitude was somewhat
different.
In the first place, I had now been in prison for some months,
without much chance of enlivenment. The opportunity of a debate
through the labyrinth of the Defence of the Realm Regulations
seemed too good a thing to be lightly put by. Moreover, I was
anxious to discover some of the items that furnished my leabhran. I
was not disappointed. As I had expected, deftly mixed among the
questions put to me about my own doings were a number of
questions that involved others. Also, as I had expected, a week’s
study of the Regulations left the rather interesting legal debate not
altogether a one-sided matter; for a number of points were
conceded to me, which, when I afterwards sought to take advantage
of them, proved to have been made without any deep knowledge of
the possibilities the Regulations offered. One or two matters of
interest emerged, however.
For instance, the Committee had some little difficulty in explaining
exactly why, if I as an Irishman was to be interned as an
This, I was told, was a political matter. Strangely enough, it was
exactly so I had conceived it. Then I was informed that I was only
considered as an alien for the purposes of that particular act, that in
other matters my citizenship under the law was not disputed. By
which it appeared that I was an alien when my imprisonment was
desired, but not an alien when my personal and national freedom
was to be consulted.
Then, among other questions, I was asked if I had or had not
endeavoured to get Irish farm labourers into touch with Irish farmers
in order to stay their migrating to England, where they could be
taken under the Military Service Act. On my asking on what authority
the question was put, I was answered that it was so alleged in the
local police report. My answer was an admission of the charge. I
suggested that it might have a bearing that the assurance had been
made in Parliament that farm labourers from Ireland could not be
taken under the Military Service Act. But it was interesting to
discover that a benefit intended to Ireland was made the basis of a
charge; and it was interesting to discover the furniture that found its
way into police reports.[A]
When I came out and explained how it was I had remained so long,
when all the others had been dispatched in two minutes or three, I
was told that I had at least ensured continued internment. The price
was not exhorbitant.

FOOTNOTE:
[A] It seems worthy of note that as I write in the year 1917 the
Department of Agriculture and Technical Education have adopted
this scheme, and are being assisted in its prosecution by the
police. It took a Clown to refer to Time as a whirligig.
XXI.
The week after our excursion to Wormwood Scrubbs, seven men
were sent down to us from Frongoch, where trouble had already
begun. There were no cells to hold them in our prison, and so they
were lodged in the reception-cells under the offices, where neither
light nor air was bold enough to venture. They were brought over to
us for breakfast, and lived during the day with us until they were
taken back to bed.
Shortly afterwards five of our number were summoned to the
Governor’s office, and returned saying they were to be released that
day. We already had had that joke played on us several times, and
so we gave no heed to them. But when in a short time we saw them
industriously packing their kit, the joke wore a more earnest
expression. It was no jest, however. Although no man changed his
mien yet none but felt what a jewel freedom was when it became
within the grasp of his neighbour, and when that neighbour rose up
and went forth proudly wearing it. We sang them home, however,
gaily enough. In a week two more were sent home. These seven
comprised all the releases from Reading at the same time that two
thousand and more were released from Frongoch. It was not very
difficult to discover the reasons prompting most of these releases,
and it need hardly be said that they had little relation to the events
of Easter Week. The internments covered a much wider ground,
which was chosen for much subtler reasons. The soldier’s hand
might rule in Ireland, but the politician’s hand indexed the
internments. And as usual the politician over-reached himself. For
the men who were released found on their return that the country
judged them unworthy to remain; and the Home Office officials were
finally convinced that Ireland was inhabited by the mad when they
received shoals of letters from released men pitifully arguing that
their releases must have been in error, and giving proofs of their part
in the Rising-Out.
We, however, settled down to the honour of imprisonment with
fortitude. Already, when we had learned that the celebrations of the
12th of July had been forbidden in Ulster we had filled the gap with
a procession and a meeting in which excellent Orange speeches had
been made. Now we held a Hibernian meeting. Such things
enlivened our days.
We suffered greatly from lack of exercise, and the closeness of our
confinement began to tell upon us as the autumn approached. We
had given up going out to the work-yard for our morning exercise,
and kept to the little yard. This yard was beset on three sides by the
buildings of the jail, and on the fourth side, beyond the high wall,
Huntley & Palmer’s chimneys belched black smoke that blotted the
sky. In a corner of this yard we made a hand-ball alley. No stranger
alley was ever devised. Two windows, a drain-pipe, a railing across
steps leading to the basement, and a ventilator grating, gave
opportunity for chance and skill. And the exercise saved us.
Nevertheless, with the coming of winter the effects of our
confinement could be seen on most of us. The food, also, had
become bad. The margarine was often rancid. On two occasions the
meat made several of us ill; and for three months I lived only on
bread and porridge, both of which were, at least, clean and
wholesome. Prisons are not built as health resorts, yet precautions
are supposed to be taken that a mean of temperature is maintained.
During a week of frost, however, the temperature in my room was
46° to 48° Fahrenheit. This was inside the cells: outside, the
passage was full of draughts. Yet the prison was never ventilated,
for the only place where air could come or go was the door. The
result was that when one of the warders came in once with
influenza, every man in the prison in time fell to it.
Yet we kept our backs straight. P. J. D. was informed by the
Governor, on the authority of the Home Office, that if he would sign
an undertaking to be of good behaviour for the future he would at
once be liberated. He replied that the offer was adding insult to
injury, and he declared that if his liberation depended on his
signature of any manner of undertaking, he was destined to remain
long in prison. The Chief Warder approached others of us, thinking
to try the ground before any other offers were made; but he left
matters as he found them.
In Frongoch at this time the same attitude was being taken. Matters
there were also complicated by the attempt of the military to search
out Irishmen who had returned home from England on the passage
of the Military Service Act—to search them out, not for the Army, but
for the pleasure of thrusting them into jails. And the result of the
ensuing resistance was that seven of the leaders there were brought
to Reading and put into the reception-cells, making our number
thirty-five once again.
XXII.
So the winter days passed. The prison was wrapt continually in an
unpleasant amalgam of winter fog and Huntley & Palmer’s smoke.
We never saw the sun, though occasionally, when the fog cleared,
we could make a guess at it where it strode the sky.
Little wonder if we occasionally got upon one another’s nerves. None
of our nerves were of the best, and we all felt the deathly system of
prison life like an oppression on us, blotting out all intellectual life
and making a blank of mind and soul. Yet no outsider saw cleavage
among us. That was a principle we never let down.
Of an evening we met together and discussed different aspects of
national affairs, partly with the intention of defining our future
action, and partly with a view to defining our points of view in their
relation to one another. The two things were really one; for
satisfactorily to outline the second was already largely to complete
the first; and we were determined not to lose the chance with which
we had been so admirably furnished. Moreover, when birthdays
arrived we had modest supper-parties, in which song and good will
supplied the lack of viands.
Yet towards the end, with illness and depression settling on most of
us, we kept largely to our own cells, despite their icy temperature.
We were suffered books—carefully selected. It became part of our
business carefully to test the selection by arranging for a variety of
books to be sent in to us by friends. Especially was this so when a
happy accident gave us the name of our censor; and it was deeply
interesting to see his path among the classics of Irish literature.
In this we were assisted by our friends outside. Indeed, not the least
value of our months of imprisonment was the revelation of
friendship, and its spontaneity and strength and unity in those of our
race. We had but to express a need and it was at once met by
leagues and committees that had been gathered together, both at
home and in England, to befriend and serve us. If our state was like
that of an island it was at least an island washed by a great sea of
friendship.
The gifts cast up by the tides of that sea became embarrassing as
Christmas approached. We had altogether to dispense with prison
fare; and our thrills of excitement were not the less because we
were so remote from the outer world. But the full bounty of that sea
was never to be experienced by us.
Shut away though we were, we watched political affairs closely—
watched not merely the surface that appeared, but watched for
indications of the hidden streams that ran—and when John Dillon
brought forward his motion for the discussion of the Irish Prisoners
of War we guessed that he had learned some hint that we were to
be released. This came soon after the failure to get us to sign
pledges of good behaviour. When, however, the threatened motion
was never taken, it was clear that we were not to be released. We
were not greatly affected; but we watched that pending motion with
interest. It became a theme of daily jest with us. When, after the
change of government, the motion at last was discussed, the sign
was clear to us; and we were not surprised when, the following day,
we learned that Irish interned prisoners were to be released. In a
noncommittal way some of us began to pack—like men who were
content, the next moment, to unpack, and take whatever came
without perturbation. On Friday, the 22nd of December, we heard
that the Frongoch men were going, and during that day we learned
that a courier was expected during the afternoon with papers for our
release. No courier, however, arrived; and Sunday saw us content
again to continue as we were without complaint. It appeared, as I
afterwards learnt, that the Home Office had actually arranged for
our release together with the men at Frongoch, but that the Irish
Office had intervened. It was not till the Sunday afternoon that the
Home Office won its way. For on that day, Christmas Eve, at half-
past two, the Governor came into the prison to tell us that we were
to be ready to go out in two hours’ time. It seemed indeed that our

You might also like