100% found this document useful (5 votes)
68 views

Learning Data Mining with Python Layton download pdf

Data

Uploaded by

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

Learning Data Mining with Python Layton download pdf

Data

Uploaded by

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

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

com

Learning Data Mining with Python Layton

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

OR CLICK BUTTON

DOWNLOAD NOW

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


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

Learning Data Mining with Python Robert Layton

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

textboxfull.com

Practical Python Data Visualization: A Fast Track Approach


To Learning Data Visualization With Python Ashwin Pajankar

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

Advanced Data Analytics Using Python: With Machine


Learning, Deep Learning and NLP Examples Mukhopadhyay

https://textbookfull.com/product/advanced-data-analytics-using-python-
with-machine-learning-deep-learning-and-nlp-examples-mukhopadhyay/

textboxfull.com

Introduction to Machine Learning with Python A Guide for


Data Scientists Andreas C. Müller

https://textbookfull.com/product/introduction-to-machine-learning-
with-python-a-guide-for-data-scientists-andreas-c-muller/

textboxfull.com
Machine Learning Pocket Reference Working with Structured
Data in Python 1st Edition Matt Harrison

https://textbookfull.com/product/machine-learning-pocket-reference-
working-with-structured-data-in-python-1st-edition-matt-harrison/

textboxfull.com

Applied Text Analysis with Python Enabling Language Aware


Data Products with Machine Learning 1st Edition Benjamin
Bengfort
https://textbookfull.com/product/applied-text-analysis-with-python-
enabling-language-aware-data-products-with-machine-learning-1st-
edition-benjamin-bengfort/
textboxfull.com

Hands-on Scikit-Learn for machine learning applications:


data science fundamentals with Python David Paper

https://textbookfull.com/product/hands-on-scikit-learn-for-machine-
learning-applications-data-science-fundamentals-with-python-david-
paper/
textboxfull.com

Encyclopedia of Machine Learning and Data Mining 2nd


Edition Claude Sammut

https://textbookfull.com/product/encyclopedia-of-machine-learning-and-
data-mining-2nd-edition-claude-sammut/

textboxfull.com

Machine Learning and Data Mining in Aerospace Technology


Aboul Ella Hassanien

https://textbookfull.com/product/machine-learning-and-data-mining-in-
aerospace-technology-aboul-ella-hassanien/

textboxfull.com
Contents
Foreword
Installing Python
Editor and Integrated development environments
Differences between Python2 and Python3
Working directory
Using Terminal
Chapter 1
1.1 Objects in Python
1.2 Reserved terms for the system and names
1.3 Enter comments in the code
1.4 Types of data
1.5 File format
1.6 Operators
1.7 Indentation
1.8 Quotation marks
Chapter 2
2.1 Numbers
2.2 Container objects
Tuples
Lists
Dictionaries
Sets
Strigs
Files
2.3 Immutability
2.4 Converting formats
Chapter 3
3.1 Functions
3.1.1 Some predefined built_in functions
Obtain informations regarding a function
3.2 Create your own functions
3.3 Salvare i propri moduli e file
Chapter 4
4.1 Conditional instructions
4.1.1 if
4.1.2 if-else
4.1.3 elif
4.2 Loops
4.2.1 for
4.2.2 while
4.2.3 continue and break
4.2.4 range()
4.3 Extend our functions with conditional instructions
4.4 map() and filter() functions
4.5 The lambda function
4.6 Scoping
Chapter 5
5.1 Object Oriented Programming
5.2 Modules
5.3 Methods
5.4 List comprehension
5.5 Regular Expressions
5.6 User input
5.7 Errors and Exceptions
Chapter 6
6.1 Importing files
6.2 .csv format
6.3 From the web
6.4 In JSON
6.5 Other formats
Chapter 7
7.1 Libraries for data mining
7.2 pandas
7.2.1 pandas: Series
7.2.2 pandas: dataframes
7.2.3 pandas: importing and exporting data
7.2.4 pandas: data manipulation
7.2.5 pandas: missing values
7.2.6 pandas: merging two datasets
7.2.7 pandas: basic statistics
Chapter 8
8.1 SciPy
8.2 Numpy
8.2.1 Numpy - generating random numbers and seeds
Chapter 9
9.1 Matplotlib
Chapter 10
10.1 scikit-learn
Managing dates
Data sources
Conclusions
Foreword

Python is an interpreted, interactive, and object-oriented language. It features a library of functions, is


extendable, as it can easily create new modules, and is available for all operating systems. For these
and other reasons it is also one of the most used programming languages when it comes to data mining
and machine learning.

My goal is to accompany a reader who is starting to study this programming language, showing her
through basic concepts and then move to data mining. We will begin by explaining how to use Python
and its structures, how to install Python, which tools are best suited for a data analyst work, and then
switch to an introduction to data mining packages. The book is in any case an introduction. Its aim is
not, for instance, to fully explain topics such as machine learning or statistics with this programming
language, which would take at least twice or three times as much as this entire book. The aim is to
provide a guidance from the first programming steps with Python to manipulation and import of
datasets, to some examples of data analysis.

To be more precise, in the Getting Started section, we will run through some basic installation
concepts, tools available for programming on Python, differences between Python2 and Python3, and
setting up a work folder.

In Chapter 1, we will begin to see some basic concepts about creating objects, entering comments,
reserved words for the system, and on the various types of operators that are part of the grammar of
this programming language.
In Chapter 2, we will carry on with the basic Python structures, such as tuples, lists, dictionaries,
sets, strings, and files, and learn how to create and convert them.

In Chapter 3 we will see the basics for creating small basic functions, and how to save them.

Chapter 4 deals with conditional instructions that allow us to extend the power of a function as well
as some important functions.

In Chapter 5 we will keep talking about some basic concepts related to object-oriented
programming, concept of module, method, and error handling.

Chapter 6 is dedicated to importing files with some of the basic features. We will see how to open
and edit text files, in .csv format, and in various other formats.

Chapters 7 to 10 will deal with Python's most important data mining packages: Numpy and Scipy for
mathematical functions and random data generation, pandas for dataframe management and data
import, Matplotlib for drawing charts and scikit-learn for machine learning. With regard to scikit-
learn, we will limit ourselves to provide a basic idea of the code of the various algorithms, without
going, given the complexity of the subject, into details for the various techniques.

Finally, in Conclusions, we will summarize the topics and concepts of the book and see the
management of dates and some of the data sources for our tests with Python.

This book is intended for those who want to get closer to the Python programming language from a
data analysis perspective. We will therefore focus on the most used packages for data analysis, after
the introduction to Python's basic concepts. To download the code, go more into depth for some topics
and for more information about the practical part you can visit my website, Datawiring.me. From the
site homepage you can also subscribe to my newsletter to keep track of news in the code and last
posts.

Given the introductory nature of the course, in any case, the advice is to write the code manually to
get familiar with I and being able to handle it, especially for readers who have just begun
programming.
Installing Python
Python can be easily installed from https://www.python.org/downloads/ in both version 2 or 3. It is
already preinstalled on Unix systems, so if we have a Mac or Linux, we can simply access terminal
and type "python".

From the python.org website, simply download the most suitable version for your operating system
and proceed with installation following the on-screen instructions.
Editor and Integrated development environments
There are many ways to use a programming language, such as Python. We can simply write the first
lines from the terminal: then, once the programming language is installed, if necessary (depending on
the operating system you are using there will be some versions of Python already integrated) we will
open a terminal window and digit its name.

Writing code this way, when it


comes to doing more than a few examples, may, however, prove to be somewhat uncomfortable. For
this reason, you can use text editor or IDE, Integrated Development Environment, or Integrated
Development environments. This way, we simply write code scripts, which we will then save with
the .py extension, which we could later run to verify the correct functioning.

There are many free and paid editors that differ in their completeness, scalability, ease of use. Among
the most used editors are Sublime Text, Text Wrangler, Notepad++ (for Windows), or TextMate (for
Mac). But we can also use a simple text editor.

As for integrated development environments, or IDEs, Python-specific ones are for instance
Wingware, Komodo, Pycharm, Emacs, but there are really lots of them. This kind of tools provide
tools to simplify work, such as self-completion, auto-editing and auto-indentation, integrated
documentation, syntax highlighting, code-folding (the ability to hide some pieces of code while you
Works on other parts), and support for debugging.

Spyder (which is included in Anaconda) and Jupyter are the most used in Data Science, along with
Canopy. A useful tool for Jupyter is nbviewer, which allows the exchange of Jupyter's .ipynb files,
which can be downloaded at http://nbviewer.jupyter.org and can also be linked to Github.

As for Anaconda, a very useful tool as it also features Jupyter, it can be downloaded for our operating
system from this link. The list of resources that are installed with Anaconda (over 100 packets for
data mining, maths, data analysis and algebra) can be viewed opening a terminal window and then
typing:

conda list

Part of the resources installed with Anaconda

We can program Python through one or more of these tools, depending on our habits and what we
want to do. Spyder and Jupyter are very common for data mining, which are both available once
Anaconda is installed. These are tools that can be used and installed individually (eg Jupyter can be
tested from this link), but installing Anaconda makes it easy to work, as it provides us with a whole
host of tools and packages.

S pyder Home S creen


Example of open script on Jupiter

The Python code can then be run directly from the terminal, or saved as .py file and then run from
these other editors. What tells us we are running the Python code is the ">>>" symbol at the beginning
of the prompt.

To best follow the examples in this book I recommend installing Anaconda from the Continuum.io
website and using Jupyter. Anaconda automatically installs a set of packages and modules that we
will then use and we will not have to reinstall each time from the terminal.
Anaconda's main screen
Differences between Python2 and Python3
Python is released in two different versions, Python2 and Python3. Python2 was born in 2000
(currently the latest release is 2.7), and its support is expected until 2020. It is the historical and most
complete version.

Python3 was released in 2008 (current version is 3.6). There are many libraries for Python3, but not
all of them have been yet converted for this release from Python2.

The two versions are very similar but feature some differences, for example with regard to
mathematical operations:

Python 2.7

5/2
2

# Python2 performs division by breaking the decimal

Python 3.5.2

5/2
2.5

To get the correct result in Python2 we have to specify the decimal as follows:

5.0/2
2.5

# or like this

5/2.0
2.5

# or specifying we are talking about a decimal (float)

float(5)/2
2.5

To keep the two versions of Python together, you can also import Python into a form called future,
allowing to import Python3 functions into Python2.

from __future__ import division


5/2

2.5

For a closer look at the differences between the two versions of Python, you can access this online
resource.

What is the difference between the two versions and why choose one or the other? Python2 represents
the best-defined and stable version, while Python3 represents the future of the language, although for
some things the two versions do not coincide. In the first part of this text we will always try to
highlight the differences between the two versions. From chapter 7 onwards, the section on data
mining packages, we will use Python3.
Working directory
Before we start working, we set the work directory on our computer. Setting up a work directory
means setting up a home for our scripts and our files, where Python will automatically look at when
we ask it to import a file or run a script. To find out what our work directory is, simply type this on
the Python shell:

import os

os.getcwd()
‘~/valentinaporcu'

# to edit the working directory, we use the following notation, inserting the new directory in
parentheses

os.chdir(“/~/Python_script”)

# then let’s check if it has been correctly changed

os.getcwd()
‘~/Python_script’

Setting up a working directory means that when we're going to import a file that is in our workbook,
we can simply type the name followed by extension and quotation marks in this format:

“file_name.extension”

For instance:

"dataframe_data_collection1.csv"

Python will directly check if there is a file with that name inside that folder and it will import it.
Same thing when we save a Python file by typing it on our computer: Python will automatically put it
in that folder. Even when we run a Python script, as we will see, we will have to access the folder
where the script (the working directory or another one) is located directly from the terminal.

If we want to import a file that is not in the working directory but elsewhere on our computer or on
the web, we can still do this, this time by entering the full file address:

“complete_address.file_name.extension”

For instance:

"/Users/vp/Downloads/dataframe_data1.csv"
Using Terminal
Let us see how to run Python scripts. First, let us open a terminal window.

As you can see, we see the dollar symbol ($) not the Python shell symbol (>>>). We can view the list
of our folders and files with the ls command.

At this point, we can move to the Python_test folder, for example:

cd Python_test

In the folder where I moved, Python_test, I find my Python scripts, that is, the .py files that I can run
by writing like this:

python test.py

test.py is the name of the script I am going to run.


Chapter 1
Introductory notions
Objects in Python
In Python, any item is considered an object, that is, a container to place our data. In Python there are
many types of objects: tuples, lists, sets and dictionaries, and are called in container English. All the
Python processing process is based on objects.

Each object in Python is distinguished by three properties:

a name
a type
an ID

Object names consist of only alphanumeric characters and underscores, so all characters between A-
Z, a-z, 0-9, and _. Type is the type of object, such as string, numeric, or boolean. The ID is a number
that uniquely identifies our object.

The objects remain inside the computer memory and can be retrieved. When no longer needed, a
garbage collector mechanism frees up busy memory.
1.2 Reserved terms for the system and names
Python has a set of words that are reserved for the system and cannot be used by users as names for
objects or functions. Such words are:

and as assert break class continue def del elif else except exec False finally for from global if
import in is lambda None not or import in pass print raise return True try while with yeld

These words cannot be used as names for our objects. Object names in R must be subject to some
rules:

must begin with a letter or underscore _


they must contain only letters, numbers, and underscores
they are case sensitive, so a test object is not the same as a TEST object or a Test object
1.3 Enter comments in the code
In Python, any comment preceded by the # symbol is not read by the program as a code, but is
ignored. This is very useful to comment on the code and resume it later. Comments can be written
both on the code to comment and on the side.

# comment no. 1
print(“Hello World”) # comment no. 2

To write a comment on multiple lines, we can also use three times the quotation marks, like this:

“””
comment line 1
comment line 2
comment line 3
“””
1.4 Types of data
Python data can be of various types. We can summarize them in the table below:

Data type Description Example


int (integer) integers 1, 20, -19
float
float 1.7, 12.54
numers
complex complex 657.23e+34
“Hello World”, ‘stringa 1’,
str (string) strings
“”” stringa 2 “””
list lists list = [‘a’, ‘b’, ‘c’ ]
tuple = (‘Laura’, 29,
tuple tuples
‘Andrea’, 4)
dictionary = {‘name’ :
dictionary dictionaries
‘Simon’, ‘key’: ‘D007’}

To know what type an object is, we can always use the type() function:

# we create an x object

x=1
type(x)
<class 'int'>

# a y object

y = 20.75
type(y)
<class 'float'>

# and a z object

z = “test”
type(z)
<class 'str'>
1.5 File format
Once you have created a script in Python, you need to save it with a .py extension. Typically, when it
comes to complex scripts, we will create a script on an editor that we will then run. A .py script can
be written by one of the different editors we've seen, even a normal text editor, and then renamed with
.py extension.
1.6 Operators
On Python we find a series of operators, divided into several groups:

arithmetic
of assignment
of comparison
logical
bitwise
of membership
of identity

Beside these operators, there is also a hierarchy that marks the order in which they are used.

Mathematical operators
When we open Python, the simplest thing we can do is use it to perform math operations, for which
we use mathematical operators:

Operator Description Example


+ addition 3+2=5
- subtraction 10 - 4 = 6
* multiplication 4 * 3 = 12
/ division 20 / 2 = 10
% modulo 21/2 = 1
** exponentiation 3**2 = 9
10.5//2 =
// floor
5.0

We then open Python and perform some examples of mathematical operations:

10+7
17

15-2
13

2*3
6
10/2
5

3**3
27

10/3
3

25//7
3

Comparison and membership operators


In Python we also have some comparison operators or comparators.

Operator Description
> greater than
< lower than
== equal to
>= greater or equal
<= lower or equal
!= different
is identity
is not non identity
in exists in
not in does not exists in

These operators are used to test relationships between objects. Let us see some examples:

# we create two objects

x=5
y = 10

# let us verify if x is greater than y

x>y
False

# the output is a logical vector that tells us that x is not greater than y
# let us see if x is less than y

x<y
True

# time the answer is affirmative

# we create another z object that with the same value as x

z=5

# let us verify with equality operator if z is equal to x

z == x
True

# even in this case the output is positive

# let us verify if z is different from y

z != y
True

# we create a tuple

v1 = (1,2,3,4,5,6,7)

# and verify if the number 2 is in the tuple

2 in v1
True

# let us verify if element 8 is NOT in tuple v1

8 not in v1
True

# let us verify if element 7 is NOT in tuple v1

7 not in v1
False

If we compare text strings, Python counts the characters so in this case the </> symbol is meant as
"how many characters in string1 is greater than the number of characters in string2?" For instance:
"valentina" > "laura"
True

We cannot compare strings and numbers, because we would get a mistake.

Bitwise operators
Bitwise operators are useful in specifying more than one condition when, for example, we need to
extract data from an object, such as a dataset.

Operator Description
& and
| or
^ xor
~ bitwise not
<< left shift
>> right shift

Bitwise operators can be used together with comparators, for example:

3 < 4 and 4 > 3


True

# and also

3<4&4>3
True

# see an example with OR (|):

3<4|4>3
True

# at least one of the statements must be valid

3 == 4 or 4 > 3
True
Assignment operators

Assignment operators assign a name to a given object.

Operator Description Example


basic assignment
= x=5+6
operator
adds an element and
x += y (corresponds
+= assigns the result to
to a x = x + y)
the name
subtracts an element
x -= y (corresponds
-= and assigns the result
to a x = x-y)
to the name
divides an element
x /= y (corresponds
/= and assigns the result
to a x = x/y)
to the name
multiplies an element
x *= y (corresponds
and assigns the result
*= to a x = x*y)
to the name

x %= y (corresponds
modulo and
%= to a x = x%y)
reassignment
x **= y
exponentation and (corresponds to a x
**=
reassignment = x**y)

x//=y (corresponds
floor division and
//= to a x = x//y)
reallocation

Let us see some examples:

# we create an x object of the value 10

x = 10

# sum x and subscribe again with the same name

x=x+5

15
# let’s try “+=“

x += 5

20

# and now “-=“

x -= 5

15

# now we use the operator “*=“

x *= 3

45

# and the operator “/=“

x /= 3

15

# to end the operator “**=“

x **= 2

225

# and finally the operator “//=“

x //= 2
x

112

Each time Python performs the operation and records the result again in the x object

Operators order
When it comes to math operators, we have to consider that there is a priority in case brackets are not
inserted. There are a number of priority rules that govern which operation is to be performed before
and after (think of mathematical operations where multiplication takes precedence over addiction).

Operator Priority (highest to lowest)


** exponentiation has the highest priority
- denial
* / // % multiplication, division, modul, floor division
+- addition and subtraction
>> << bitwise right and left
& bitwise AND
^| bitwise OR
<= > < >= lower, bigger, smaller, bigger than
== != equal, different
= += -= *= /= %= **= //= assignment operators
is / is not comparison
in / not in comparison
not / or / and comparison
1.7 Indentation
Python uses indentation to limit blocks of instructions, making the code more readable. Code block
are thus defined by indentation. Typically an indentation corresponds to four spaces.

Let us see an example of indentation in a function:

def multiply_xy(x, y):


‘’’let’s multiply x and y
'''
return(x*y)

multiply_xy(5,6)
30
1.8 Quotation marks
Quotation marks in R are mostly used to define strings and can be single, double or triple. Triple ones
are sued to wrap words and insert comment on multiple lines, for example, to create documentation
within a function that we are creating.

ex1 = 'single quote'

ex2 = "double quote"

ex3 = “””
text string 1
text string 2
text string 3
“””

We will better deal with strings management later in the discussion.


Another Random Scribd Document
with Unrelated Content
"'Hush, hush!' said she. 'You will spoil all by this
vehemence. You must do exactly as you are bid and all will
be well, at last. Dress yourself in the clothes you will find in
this basket, and be ready when the bell rings for the
midnight service.'"

"'Where am I to go?' I ventured to ask."

"'To a safe asylum which has been found for you, and where
you may spend the rest of your days in penitence and
prayer.'"

"I thought I knew what that meant well enough, but I did
not care. At midnight I was taken from my prison
blindfolded, and carried down stairs and into the fresh air. I
was placed in a litter and traveled for two days, I think,
stopping now and then in some secluded place for a little
rest and refreshment. On the third day there was an
unexpected end put to my journey. We were attacked by
outlaws. My two conductors fled, as I guessed, without
exchanging many blows. With many jests, but not unkindly,
the robbers drew me out of my litter. I was so stiff with
sitting I could hardly stand upright."

"'Why, 'tis a poor feeble old woman!' said the leader of the
gang. 'Hey, what! Cannot you walk?' he asked, as I tried to
take a step."

"'My feet are tied' I managed to say, and so they had been,
whether by command to my attendants or to save
themselves trouble, I do not know."

"'And so they are,' said another man, with indignation. 'The


brutes, to use an old white-headed woman like that. Where
were they taking you, good mother?'"
"'I do not know,' I answered. 'They said to a safe asylum—
to some cell or convent, I suppose—but I promised not to
tell,' I added. 'Please do not heed my words, I am
something dazed.'"

"The men glanced at each other and whispered together.


Then the man who seemed to be the leader asked me
where I wished to go."

"'I know not,' I answered. 'I have not, a friend on earth.'"

"'Tis a piteous case,' said the outlaw. Then, after a little


more conference, two of the men took me between them
and led me into the thicket, where I was made to sit down
and eat. At night, the man in charge of me made me a kind
of bed of leaves, and bade me lie down and sleep without
fear."

"Curiously enough, I was not at all afraid, and did as I was


bid as calmly as if I had been in the convent. In the first
gray of the morning, I was again blindfolded and led for
some distance without a word being said on either side.
Finally I was bade to sit down."

"'You must remain here without uncovering your eyes till


you hear the church clock strike five,' said my conductor.
'You will find yourself not far from a house, where they will,
no doubt, feed and shelter you. Obey and no harm will
befall you, if you keep your own counsel.'"

"'I would I had something wherewith to reward your


kindness,' said I."

"'Nay, we want no reward from such as you,' answered the


man. 'You are not our game. Farewell, good mother, and
good luck to you.'"
"I heard the outlaws' retreating steps, and then all was still,
save for the singing of the birds and the other woodland
noises. I waited patiently till I heard a distant clock strike
five. Then I unbound my eyes and looked about me."

"I found myself in a thick wood like a neglected park. There


was a narrow vista through the trees, at the end of which I
saw an old building from one chimney of which smoke was
rising, showing that it was inhabited, and thither I bent my
way. I found nobody but one old woman—poor Martha—and
as she was not so deaf as she is now, I made her
understand so much as I thought fit to tell her: namely, that
I had been traveling, had lost my way, and been out all
night, and I prayed her to give me hospitality."

"'Ay, ay!' said she. 'Meat and drink you shall have, and as to
lodging, we will see what my master says. He is here now,
my good dame?'"

"'Who is your master?' I ventured to ask."

"'Why, his Grace of Suffolk, no less,' was the answer. 'This


tumble down old house belongs to him, and it pleases him
to come hither now and then for a day's sport.'"

"I had gathered my wits together by the time I had rested


and eaten my breakfast, and I made up my mind what to
do. I knew my husband had been a far-away kinsman of the
Brandons, and I determined to tell his Grace the whole
story, and to throw myself on his mercy. I did so. He heard
me with many expressions of pity and kindness."

"'Your husband was a gallant young man,' said he. 'I knew
him well, but knew not what had become of him. I will
consider your case and see what shall be best for you.'"

"The next day as he was going away, he called me."


"'I can think of no better counsel than for you to remain
here and keep close,' said he. 'Nobody ever comes hither
but myself or some trusted servant. This old hall hath
sheltered the wanderer before now. Bide you here, then,
and go not forth—not even to church at present. Your own
family doubtless think you dead, and the convent
authorities are too full of their own troubles just now to
make much search for you, but yet it is best to be on the
safe side. How it comes that you are alive, I cannot guess.'"

"'They were not unkind to me beyond keeping me confined,'


said I. 'I pray, your Grace, what year is this?'"

"He told me."

"'Then I have been in prison nine years,' I said, 'and in that


time I have not seen a human face more than three times,
save when I was ill.'"

"'Poor thing, no wonder you are so sadly aged,' he said, 'but


there will be an end of all that soon, and full time it was
so.'"

"How long is it since you came here?" I asked, as she


paused.

"Two years come next spring."

"Then you must have been sent away just before the
convent was broken up."

"'Tis likely they found it convenient to get rid of me," she


returned, a little bitterly. "But I bear them no malice. I have
been pardoned too much myself not to forgive others. I had
not said even the form of a prayer for years before I came
here. I had lost all faith in the old religion, and I knew no
other. But one day looking for something wherewith to
divert myself, I found a Latin Bible. I read and read, and by
degrees the light came to me, and the truth made me free."

"And what then, dear sister?"

"There is little more to tell," she answered. "His Grace was


good enough to call me cousin before Martha, and bade her
treat me with all respect. She is a good, faithful creature,
and I love her as a sister. She grows infirm, and I fear may
not last long. But I am old, too," she added, with a smile.
"Loveday, the first time I looked into a mirror, I started back
in affright. I did not know my own face."

I would have liked to ask her a hundred questions, but


there was no more time. It was drawing toward sunset, and
I had been told to be ready by nightfall. Denys helped me
to finish my packing and to arrange securely the money and
jewels I had about me, and I was soon all ready. As soon as
it was dark, the same messenger who had brought the
litter, appeared with two horses, and we took a last farewell
of our woodland Patmos. Denys kissed and blessed me at
parting.

"We shall never meet again, but I am most thankful to have


seen your face once more," said she. "You were my first
comforter, little Loveday, and if my prayers can call down
blessings, you will not want them. Farewell, dear, precious
child, till we meet in the Paradise above."

I had to go at last. As we rode down the overgrown avenue


I looked backed and saw her standing in the door. She
waved her hand, and then the trees closed in, and I never
saw her again.

I heard afterward that she died, after all, before poor old
Martha. But she was ready to go, and it was a blessed
release. How little I guessed, when I used to look at our
house at Dartford and speculate as to the rooms I was not
allowed to enter, that my old friend and teacher was pining
away her young life in one of them. They meant it for
mercy, and I dare say ran a great risk in keeping her where
they did, but it was a doubtful mercy, after all.

CHAPTER XIII.

"EXILED, AND YET AT HOME."

WE rode all that night, and in the morning we found


ourselves in a small seaport town, or rather fishing village,
for it was little more. There was but scant time for me to
observe it. There was a low-lying fog, and we could not
even see the edge of the water in the dull twilight. A breeze
sprung up with the sun, however, the fog lifted like a
curtain, and showed a tolerably-sized vessel lying off shore.

"There she is, thank Heaven!" said our conductor. "But we


must waste no time. It will not do to lose this breeze."
We rode straight to the water's edge, where our conductor
made a signal. A boat put off from the ship, and in a few
minutes we found ourselves on board.

What a strange, desolate thing it seemed to watch the


shore of England fading away, and think that in all
likelihood, I should never see it again. In truth, we came
near to never seeing any shore again, for the breeze
increased to a gale, and for some time we were in a good
deal of danger. But our ship was stout, and the Dutch are
bold and skillful sailors, and so it came to pass that on the
fifth morning after leaving England, I opened my eyes, and,
looking at the tiny window, I caught sight of a low-lying bit
of green.

I was not many minutes in arranging my dress and joining


my uncle on deck. What a strange scene it was! We were
sailing on what seemed a great inland lake, shifting our
course every five minutes. All about, now near at hand, now
on the far horizon, were long lines of high green banks,
over which peeped, now and then, the top of a tree, or a
fantastical church steeple, with a fish-shaped weather-vane.
The sky was clear, and a fresh, pleasant breeze was
blowing; but the water was still rough from last night's
storm, and seemed, even to my inexperienced eye, to be
full of currents and eddies.

It was the oddest landscape, if landscape it could be called,


that I had ever seen, and seemed as if it might have come
up from Neptune's kingdom, like a whale, to have a breath
of fresh air and a look at the world, and might be expected
to dive again at any moment. And, indeed, it hath a trick of
diving at times with unreverent suddenness. More than
once while I lived there, we heard of a whole town or
district disappearing in the night, leaving no trace to show
where it had been.
"What is this, uncle?" I asked.

"This is Holland, my niece—Holland, our asylum, and that of


many another wanderer. These are the Isles of Zealand, and
we shall soon be at home."

My uncle spoke in a tone of enthusiasm which I could not


understand.

"And what are these great green banks which we see on


every side? Are they ramparts?"

"Ay, child, ramparts against the Dutchman's greatest foe


and best friend, the sea. But for them, all yonder fertile
fields would be under water, or at least but stagnant
morasses, the haunts of wild fowl."

"The enemy seems to have had the best of it yonder!" said


I, pointing to a place where innumerable active little figures
were running to and fro, like ants in a disturbed ant-hill.

"Yes, I doubt we shall hear of mischief," said the captain,


who could speak English very well. "Such a gale as we have
had makes wild work with the dykes, though 'twas not as
bad as though it had blown from another quarter."

"But who has built all these great arks?" I ventured to ask,
looking with amazement at the high banks and heavy
stone-work, which I could now see quite plainly.

"The Hollanders and Zealanders themselves, young lady!"


Answered the captain, with justifiable pride. "For three
hundred years and more, we have been conquering this
country from the sea. Some time or other we may have to
conquer it again from another power, who knows?"
Who knew, indeed! Only, a few weeks ago I heard that in
their contest for liberty with the cruel Spaniards, the
Hollanders had cut these same dykes, and let in the salt sea
on their grand farms and beautiful towns. Any one who has
ever lived in Holland will understand what must have been
their zeal for liberty to make them willing to let so much dirt
into their houses. I hope with all my heart they may
succeed, for if any people on earth have the right to their
own country it is the Dutch.

"When shall we be at Rotterdam?" asked my uncle.

"Why, that is more than I can tell," was the answer, "but if
all goes well, I hope we shall find ourselves at the
Boomtzees to-morrow morning. You know, my friend, this is
not a channel to be walked over blindfold."

I could not help seeing that for myself as I observed how


carefully our good captain watched the course of the vessel
and how often he heaved the lead. I understood that the
gale by disturbing the shifting sand and sandbanks had
made the navigation more troublesome than usual. In fact,
we were aground once, but our commander's seamanship
and the rising tide soon took us off. At every possible
interval, the men were busy cleaning and scraping,
varnishing and painting, so that the ship began to assume
quite a holiday appearance.

I went to bed at last, but not to sleep, except by fits and


snatches, awakened every moment by the welcome sounds
of cocks crowing, cattle lowing, and the lovely music of
church bells playing tunes before they struck the hour. At
last, weariness conquered and I fell into a deep sleep, from
which I was waked by my uncle's voice.
"Come, my maid. Here we are at home. Hasten your
preparations that we may go ashore."

It did not seem much like home to me as I followed my


uncle along the quay, having a line of ships on one side and
a row of fine painted warehouses, and dwellings on the
other. I felt more like somebody in a fantastic dream. Here
was a warehouse where great foreign looking bales were
being carried in, while in the window stood pots of flowers
behind the clear glass. There, we met a group of what were
evidently country women, who yet wore bands and
headdresses of gold and silver, with great gold earrings
dangling over their cheeks and bosoms. And again, two
maid-servants in the same odd attire were cleaning the
outside of a house, yea, scrubbing the very bricks, with as
much zeal and apparent pleasure as my Lady Frances would
have shown at her music.

And then the language! I could not understand it, and yet it
sounded as if I ought to know every word. Presently we
turned off the quay, the Boomtzees as they call it, and went
through two or three narrow streets, and over more bridges
than I ever counted afterward. At last we came into a kind
of little place or square where grass was growing, and
flowers blooming in little parterres like the figures in a
Persian rug. This square was surrounded by neat houses, as
fantastically decorated as those we had seen before, and
looking as if no dust or smoke had ever dared to come near
them. At the largest and handsomest of these, my uncle
stopped.

"This is our house," said he. "Pray God we find all well."

He knocked as he spoke, but had hardly withdrawn his hand


from the knocker, when a light foot was heard on the stairs,
and Avice, looking not at all like a heart-broken widow,
threw herself into her father's arms, and drew him into the
house. I followed, feeling somehow inexpressibly forlorn
and lonely.

"Why how is this?" asked my uncle, holding Avice off and


looking at her. "Methinks my drooping flower is blooming
again."

"Ay, and with good reason," answered Avice. "After all our
fears, Garrett has come home safe and sound, and not
much the worse for his captivity among the Moors."

"Heaven be praised! But, daughter, you do not speak to


your guest. Do you not know her?"

Avice turned—I verily believe she had taken no note of me


before—and looked at me for a moment with a gaze so like
one of her old innocent looks of wonder, that I could not
forbear smiling.

"Loveday, it is Loveday!" she exclaimed, and I had no cause


to find fault with my welcome. I was led up stairs all in a
moment, and into a parlor where sat my Aunt Holland,
looking not so much older than when I saw her last. What a
meeting it was. How we women talked and laughed and
cried, and asked endless questions and staid for no
answers. How old Sambo, his wool whiter than any sheep's,
kissed my hand and blubbered and giggled, all in a breath,
and afterward danced a dance of triumph out in the
courtyard. By and by Avice would lead me to my room to
refresh myself with a change of dress before eating.

I declare, when I was left alone in the room, I was afraid to


stir. I thought we had been neat at the convent, but our
utmost cleanness was sluttery compared to that which
reigned here. The glass windows, which were seen every
where in Holland long before they were common in
gentlemen's houses in England, were clear as air, and the
laced curtains which veiled the lower parts whiter than any
snow. Beautiful pots of Delft ware, holding growing and
blossoming plants, stood in the window-seat, and the very
floor was of rare wood waxed and polished like a mirror, so
as to make walking somewhat perilous to the unaccustomed
foot. The bed was all in white and pale blue, and there was
not so much as a speck of dust to be seen any where.

Avice left the room, and presently came back with an armful
of clean linen and a gown. She would help me to dress, but
that I would not allow, so bidding me come down when I
was ready, she left me. I dressed myself at last, and went
back to the room I had left, where I found a table spread
with all sorts of good things, while a tall, handsome,
solemn-looking maid-servant, wearing the same sort of
head ornament I had seen in the street, kept bringing still
more. Here I was introduced to my cousin's husband, a
stately gentleman, but looking worn and sunburned. I had
found my appetite by this time, and did full justice to the
dainties before me.

"And Katherine is well?" asked my uncle.

"Yes, very well; and her new babe. The little lad hath had
the ague, but is recovered—so she writes."

"Ay, they are like to have a fine wreath of olive branches,"


said Mynheer Van Alstine, with something of a sigh.
"Methinks they might spare us one."

"All in good time," returned my aunt. Then to me: "So you


have never married, sweetheart?"

"No, dear aunt," I answered, feeling my cheeks grow red.


"We must find her a husband somewhere," said Mynheer
Van Alstine. "It will never do to leave so fine a maid to
comb St. Catherine's hair, as they say in France."

"All in good time," repeated my uncle, smiling.

"Loveday is not so old or so foul-favored but she can afford


to wait a while to comfort her poor old uncle. What,
sweetheart—wilt thou live single for my sake, since my own
girls have been carried away captive by these piratical
Dutchmen?"

"I desire no better fate," said I.

Whereat he laughed, and addressing himself to his son-in-


law, he began to ask about his captivity among the Barbary
Moors.

"So they were not unkind to you?"

"Nay, they treated me well enough so soon as they found


out I was no Spaniard," answered the gentleman. "They
hate the Spaniards, and with good reason."

"I wonder who doth not," said mine uncle, under his breath.

"I had traded with them before now, and could speak their
language, after a fashion," continued my cousin Garrett. "I
had once been able to do some service to a merchant of
Tripoli, and I thought if I could get speech of him, he might
do me a good turn. At last, after long waiting, I succeeded
in sending him word, and in a few days I found myself in his
house and treated with all kindness. He found means for me
to go to Smyrna, and from thence the way home was easy."

"It was well you fell into the hands of the Moors, and not
into the claws of the Inquisition," said my uncle. "Strange
that one should find better treatment at the hands of
heathens and infidels than of those who call themselves
Christians."

"We may find those same claws clutching at our throats


even here, and that before we know it," observed Garrett.
"I can tell you, father, I like not the signs of the times. But
will you walk to the warehouse with me, and I will see that
our fair cousin here hath her finery sent home safely."

"'Tis but little finery the poor maid hath brought with her,"
answered my uncle, smiling. "Our flight was too secret and
sudden for that. But I will walk with you, and we will leave
the women to gossip to their heart's content."

"As if they would not gossip worse than any women when
they get two or three together," said Avice, laughing. "But
sit you down, and rest, Loveday. I will but give some
orders, and be with you again directly."

She set an arm-chair for me as she spoke, and I was not


sorry to be left alone a few minutes, for my head was fairly
whirling.

The room where I sat was wide and high, handsomer than
any in Suffolk house, and fairly crowded with carved and
inlaid cabinets, damask-covered chairs and little tables. The
projecting window was partly veiled by broad white
curtains, and just above it was an arrangement of bright
mirrors, jointed curiously together, whereof I could not at
first perceive the use, but I presently discovered that by it
one was enabled to see, without being seen, all that went
on in the street. The little square or place before the house
was green as emerald, and not a speck or stick was to be
seen on its surface, while a pond in the midst gave
entertainment to a pair of swans and some white ducks. On
the highest chimney of a fine house across the square was
a pile of rubbish, at which I was wondering, when I saw a
long-legged and long-billed bird alight near it, and begin
strutting up and down in a pompous way, that reminded me
of the old beadle in our parish church in London.

"What is that bird?" I asked of Aunt Joyce, who just then


entered the room.

"Why 'tis a stork, child. The people here treat them as a


kind of sacred animal, and the man who should kill one
would be looked upon as a murderer. 'Tis counted a very
lucky thing to have a stork's nest on one's house. We have
a fine one. 'Tis said that the young birds will carry their old
parents on their shoulders, and that the parents will perish
in the fire rather than desert their young. Every one is glad
to see the storks come back in the spring."

"No wonder, if they are such good creatures. But, aunt, are
all the people here as neat in their ways as my cousin? The
house is so clean, I am almost afraid to move for fear of
soiling something."

"You will see," answered my aunt. "I do think, niece, that


Dutch women in general think of their houses not so much
as places to dwell in, as objects on which to exercise their
love for cleansing. 'Tis said that the pastor of Brook, which
is the very Paradise of neatness, found it hard to interest
the women of his parish in heavenly things, till he described
Heaven as a place where golden pavements admitted of
unlimited scouring. Avice falls in with these ways easily
enough. You know she was always a born housekeeper, but
I fancy poor Katherine is looked upon as a helpless slattern
by her Dutch neighbors. Happily for her, Arthur's
congregation is made up of English and Scotch people, who
are not quite so particular."
"And Katherine is happy in her marriage?"

"Oh, yes. Her husband is one of the best of men, and she
hath four lovely babes—the last I have not seen. They are
not rich, nor ever will be, at least in this world's goods, but
they have treasure in Heaven, ay and in this world also. I
never saw a better ordered family of children. 'Tis a great
grief to Garrett and Avice that they have none; but, as I tell
them, there is time enough, and it may be better after all,"
said my aunt, sighing. "In a gale, those are best off who
spread the least sail."

"But is not the Protestant religion allowed here?" I asked, in


surprise. "I thought there was no danger on that score."

"'Tis rather winked at than allowed," replied my aunt. "The


emperor is a crafty man, and knows well the temper and
drift of this people. I believe he will avoid a quarrel if he
can, and he is not a man to be driven by the Church of
Rome further or faster than he likes to go. But he grows
old, and talks at times of abdicating in favor of his son, who
is, as all men say, a cold, cruel bigot, valuing nothing so
much as what he calls—God save the mark—Christian and
Catholic unity. I believe the hour which puts the reins into
his hands will be a sad one for Holland."

"Heaven help us," said I. "Is there to be no rest in this


world?"

"Not that I know of," replied my aunt, with that sweet, wise
smile that I remembered so well. "The Master, at least, has
promised us none, and what right have we to expect peace
with His worst enemy. Mark my word, child, if the day ever
does come that the church and the world have no
controversy, that will be the worst day the church will ever
see. But now tell me of our friends, the Davises. Were they
not greatly relieved to hear of Margaret's safety?"

"They had not heard it, the last I knew," I answered,


surprised. "Where is she?"

"At Amsterdam, with her husband, who has fallen on his


feet as I may say, having gotten work in one of the great
printing houses, where his skill hath already raised him to a
high place, and Margaret hath a school for young maids,
which is very successful."

"And so it should be. One better fitted for such an office


could not be. I hope I may see her, for she hath been one of
the best friends I ever had."

But I must not linger over the history of those quiet, happy
days; for happy they were spite of the secret grief and
longing which no one guessed—or so I believed. I had
thought the matter over and over, and had gained all the
light I could from an honest Study of Holy Scripture, and I
could not see that I was guilty of any sin in loving Walter
Corbet. It was not sacrilege, as I had first believed, since no
word in the Bible prohibited priests from marrying. I might
make my love a sin, it was true, if I let it make me gloomy
or discontented; if I brooded over it and occupied my
thoughts therewith so as to interfere with my duties to God
or man. But this I was humbly resolved not to do. My Father
had laid this cross upon me, and I would bear it till he saw
fit to remove it, or to change it for that crown which he hath
promised to them that endure to the end. I had read some
romances and tales of maids who died for love or had
unworthily cast themselves away. The first might perhaps
come—the last I thought never. It seemed to me, and does
so seem now, that the very fact of a woman's loving
honestly would make her self-respecting and discreet.
Passion might make women act unworthily—true love
never!

Thus thinking and resolving, I went to work with all my


might at whatever my hands could find to do, and I only
wished it were more. Garrett Van Alstine was still rich
despite a few losses, and my uncle was also well-to-do.
Servants were plenty, and I soon found the Dutch maids
brooked little interference with their ways. There seemed to
be no indigent people; one never saw a beggar in the
street; and even in the poorest parts of the town there were
the same comfort and neatness, though of course not the
same amount of luxury, which were found in our own
neighborhood.

I made a long visit to Katherine, and one to Margaret Hall,


in Amsterdam. I could have found plenty to do in either
place, for Kate's olive branches, as Garrett called them, had
sprung very close together, and though Arthur's
congregation gave according to their means for their
pastor's support, yet those means were not great. There
were plenty both of steps and stitches to be taken in the
little parsonage, and I would have liked well to stay with
Katherine, whose English ways, to tell the honest truth,
suited me better than Avice's Dutch ones.

Margaret Hall was, if not rich, yet well-to-do. Her school had
grown to as large a size as she could manage, and both she
and her husband would have liked me to take it off her
hands, and have her free to help her husband in correcting
of the press and the like. The work would have suited me
well enough, but my uncle would not hear of my leaving
him, and indeed showed more of his old choleric temper on
the occasion than I had yet seen. Of course his will was my
law, so I said no more about the matter.
At last however, I found work nearer home. There was an
English congregation in Rotterdam, at present without a
pastor. Many of them were poor people who had fled on
account of their faith, losing all for the sake of the gospel. I
soon got in the way of visiting among them, and finding
there were a good many children, I proposed to my uncle
with some diffidence—not knowing how he would like it—
that I should set up a small school for the little maids,
where they could learn to read, sew and spin, and other
such arts as should help them to earn a living. I was
pleasantly surprised to find him take up the idea with great
pleasure, saying that he had often wished some one would
do that work. The parents of the children were equally
pleased. My uncle found out and furnished a small room,
and I discovered a suitable assistant—such a person as we
now should call a dame—in an elderly widow without
children, a part of whose house we rented for the school. I
soon had my rooms full of the little English girls, and there I
regularly spent half my day overseeing the work, teaching
the little things to read the Scriptures, and now and then
moderating a little Dame Webster's zeal for discipline.

In this way I spent a not unhappy year, attending to my


schools, taking lessons in lace-making and entertaining my
uncle and cousins in the evening with music when we had
no guests, which was not often, for Avice was in great favor
with her husband's large family, and the good folks quickly
adopted me as a kinswoman. I learned to talk Dutch pretty
fluently, by the simple process of talking right or wrong, and
by reading such books as I could lay hands on. My cousin's
house was one of the gathering places of the distinguished
reformers whereof Holland was full of at that time. They
were a wonderful scholarly set of men, and much given to
long theological discussions on matters which, it seemed to
me, were altogether beyond the scope of human reason.
Many times the discussion waxed so warm that I thought it
would end in a downright rupture, but all would presently
be friends again over the dainty supper dishes which Avice
provided on these occasions, and I never saw men enjoy
good things more.

CHAPTER XIV.

ANOTHER HOME.

AUGUST had come round again. Such of the Dutch


merchants as had places in the country retired to them and
passed long hours contemplating their flower beds and their
fat cows. For my own part, I liked Rotterdam better since
there, at least, we had the fresh sea-breeze. Truth to tell,
with all its neatness, Holland is not a savory country in hot
weather.

Garrett and Avice had gone down to visit Katherine, and the
maids had seized on the chance for a perfect carnival or
orgy of brushing and scrubbing, though the house was
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like