Learning Data Mining With Python Layton All Chapter Instant Download
Learning Data Mining With Python Layton All Chapter Instant Download
com
https://textbookfull.com/product/learning-data-
mining-with-python-layton/
https://textbookfull.com/product/learning-data-mining-with-python-
robert-layton/
textbookfull.com
https://textbookfull.com/product/practical-python-data-visualization-
a-fast-track-approach-to-learning-data-visualization-with-python-
ashwin-pajankar/
textbookfull.com
https://textbookfull.com/product/advanced-data-analytics-using-python-
with-machine-learning-deep-learning-and-nlp-examples-mukhopadhyay/
textbookfull.com
https://textbookfull.com/product/10-minutes-38-seconds-in-this-
strange-world-elif-shafak/
textbookfull.com
Toronto Notes 2023 39th Edition Anders W. Erickson
https://textbookfull.com/product/toronto-notes-2023-39th-edition-
anders-w-erickson/
textbookfull.com
https://textbookfull.com/product/knowledge-and-ideology-the-
epistemology-of-social-and-political-critique-1st-edition-michael-
morris/
textbookfull.com
https://textbookfull.com/product/case-studies-in-infection-control-
first-edition-chand/
textbookfull.com
https://textbookfull.com/product/the-longman-reader-12th-edition-
judith-nadell/
textbookfull.com
https://textbookfull.com/product/peak-how-great-companies-get-their-
mojo-from-maslow-revised-and-updated-2nd-edition-chip-conley/
textbookfull.com
Frailty and Kidney Disease: A Practical Guide to Clinical
Management Carlos Guido Musso
https://textbookfull.com/product/frailty-and-kidney-disease-a-
practical-guide-to-clinical-management-carlos-guido-musso/
textbookfull.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
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.
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
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.
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
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
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
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
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.
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”)
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.
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
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:
# 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:
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.
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
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:
10+7
17
15-2
13
2*3
6
10/2
5
3**3
27
10/3
3
25//7
3
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:
x=5
y = 10
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
z=5
z == x
True
z != y
True
# we create a tuple
v1 = (1,2,3,4,5,6,7)
2 in v1
True
8 not in v1
True
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
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
# and also
3<4&4>3
True
3<4|4>3
True
3 == 4 or 4 > 3
True
Assignment operators
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
x = 10
x=x+5
15
Random documents with unrelated
content Scribd suggests to you:
I seed him within these days three;
And he has slain an English captain,
And ay the fearder the rest may be.’
14
‘I’d give twenty shillings,’ said the captain,
‘To such a crooked carle as thee,
If you would take me to the place
Where that I might proud Wallace see.’
15
‘Hold out your hand,’ said Wallace then,
‘And show your money and be free,
For tho you’d bid an hundred pound,
I never bade a better bode,’ [said he].
16
He struck the captain oer the chafts,
Till that he never chewed more;
He stickd the rest about the board,
And left them all a sprawling there.
17
‘Rise up, goodwife,’ said Wallace then,
‘And give me something for to eat;
For it’s near two days to an end
Since I tasted one bit of meat.’
18
His board was scarce well covered,
Nor yet his dine well scantly dight,
Till fifteen other Englishmen
Down all about the door did light.
19
‘Come out, come out,’ said they, ‘Wallace!’ then,
‘For the day is come that ye must die;’
And they thought so little of his might,
But ay the fearder they might be.
20
The wife ran but, the gudeman ran ben,
It put them all into a fever;
Then five he sticked where they stood,
And five he trampled in the gutter.
21
And five he chased to yon green wood,
He hanged them all out-oer a grain;
And gainst the morn at twelve o’clock,
He dined with his kind Scottish men.
B
Communicated to Percy by R. Lambe, of Norham, apparently in
1768.
1
‘I wish we had a king,’ says Wallace,
‘That Scotland might not want a head;
In England and in Scotland baith,
I’m sure that some have sowed ill seed.’
2
Wallace he oer the water did luke,
And he luked law down by a glen,
And he was aware of a gay lady,
As she was at the well washing.
3
‘Weel may ye save, fair lady!’ he says,
‘Far better may ye save and see!
If ye have ony tidings to tell,
I pray cum tell them a’to me.’
4
‘I have no tidings you to tell,
And as few tidings do I ken;
But up and to yon ostler-house
Are just gane fifteen gentlemen.
5
‘They now are seeking Gude Wallace,
And ay they’re damning him to hang;’
‘Oh God forbid,’ says Wallace then,
‘I’m sure he is a true Scotsman.
6
‘Had I but ae penny in my pocket,
Or in my company ae baubee,
I woud up to yon ostler-house,
A’these big gentlemen to see.’
7
She pat her hand into her pocket,
She powd out twenty shillings and three:
‘If eer I live to come this way,
Weel payed shall your money be.’
8
He leaned him twafold oer a staff,
Sae did he twafold oer a tree,
And he’s gane up to the ostler-house,
A’these fine gentlemen to see.
9
When he cam up among them a’,
He bad his benison be there;
The captain, being weel buke-learnd,
Did answer him in domineer.
10
‘Where was ye born, ye cruked carl,
Or in what town, or what countree?’
‘O I was born in fair Scotland,
A cruked carl although I be.’
11
The captain sware by the root of his sword,
Saying, I’m a Scotsman as weel as thee;
Here’s twenty shillings of English money
To such a cruked carl as thee,
If thou’ll tell me of that Wallace;
He’s ay the creature I want to see.
12
‘O hawd your hand,’ says Wallace then,
‘I’m feard your money be not gude;
If ’twere as muckle and ten times mair,
It shoud not bide anither bode.’
13
He’s taen the captain alang the chaps,
A wat he never chawed mair;
The rest he sticked about the table,
And left them a’a sprawling there.
14
‘Gude wife,’ he said, ‘for my benison,
Get up and get my dinner dight;
For it is twa days till an end
Syne I did taste ane bit of meat.’
15
Dinner was not weel made ready,
Nor yet upon the table set,
When fifteen other Englishmen
Alighted all about the yate.
16
‘Come out, come out now, Wallace,’ they say,
‘For this is the day ye are to dee;
Ye trust sae mickle in God’s might,
And ay the less we do fear thee.’
17
The gude wife ran but, the gude man ran ben,
They pat the house all in a swither;
Five sune he sticked where he stude,
And five he smitherd in a gutter.
18
Five he chac’d to the gude green-wood,
And hanged them a’out-oer a pin;
And at the morn at eight o’clock
He din’d with his men at Lough-mabin.
C
Johnson’s Museum, p. 498, No 484, communicated by Robert
Burns.
1
‘O For my ain king,’ quo Gude Wallace,
‘The rightfu king of fair Scotland!
Between me and my soverign blude
I think I see some ill seed sawn.’
2
Wallace out over yon river he lap,
And he has lighted low down on yon plain,
And he was aware of a gay ladie,
As she was at the well washing.
3
‘What tydins, what tydins, fair lady?’ he says,
‘What tydins hast thou to tell unto me?
What tydins, what tydins, fair lady?’ he says,
‘What tydins hae ye in the south countrie?’
4
‘Low down in yon wee ostler-house
There is fyfteen Englishmen,
And they are seekin for Gude Wallace,
It’s him to take and him to hang.’
5
‘There’s nocht in my purse,’ quo Gude Wallace,
‘There’s nocht, not even a bare pennie;
But I will down to yon wee ostler-house,
Thir fyfteen Englishmen to see.’
6
And when he cam to yon wee ostler-house
He bad bendicite be there;
. . . . . . .
. . . . . . .
7
‘Where was ye born, auld crookit carl?
Where was ye born, in what countrie?’
‘I am a true Scot born and bred,
And an auld crookit carl just sic as ye see.’
8
‘I wad gie fifteen shillings to onie crookit carl,
To onie crookit carl just sic as ye,
If ye will get me Gude Wallace;
For he is the man I wad very fain see.’
9
He hit the proud captain alang the chafft-blade,
That never a bit o meal he ate mair;
And he sticket the rest at the table where they sat,
And he left them a’lyin sprawlin there.
10
‘Get up, get up, gudewife,’ he says,
‘And get to me some dinner in haste;
For it will soon be three lang days
Sin I a bit o meat did taste.’
11
The dinner was na weel readie,
Nor was it on the table set,
Till other fifteen Englishmen
Were a’lighted about the yett.
12
‘Come out, come out now, Gude Wallace!
This is the day that thou maun die:’
‘I lippen nae sae little to God,’ he says,
‘Altho I be but ill wordie.’
13
The gudewife had an auld gudeman;
By Gude Wallace he stiffly stood,
Till ten o the fyfteen Englishmen
Before the door lay in their blude.
14
The other five to the greenwood ran,
And he hangd these five upon a grain,
And on the morn, wi his merry men a’,
He sat at dine in Lochmaben town.
D
Communicated to Robert Chambers by Elliot Anderson, Galashiels,
21 April, 1827, in a letter preserved among Kinloch’s papers. Copied,
with changes, in Kinloch MSS, I, 177. Furnished me by Mr. Macmath.
1
‘I wish we had our king,’ quo Gude Wallace,
‘An ilka true Scotsman had his nawn;
For between us an the southron louns
I doubt some ill seed has been sawn.’
2
Wallace he owre the water gaed,
An looked low down by a glen,
An there he saw a pretty, pretty maid,
As she was at the well washin.
3
‘O weel may ye wash, my bonny, bonny maid!
An weel may ye saep, an me to see!
If ye have ony tidins to tell,
I pray you tell them unto me.’
4
‘I have no tidins for to tell,
Nor ony uncos do I ken;
But up into yon little alehouse
An there sits fyfteen Englishmen.
5
‘An ay they are speakin o Gude Wallace,
An ay they are doomin him to hang:’
‘O forbid!’ quo Gude Wallace,
‘He’s owre truehearted a Scotsman.
6
‘Had I but a penny in my pouch,
As I have not a single bawbee,
I would up into yon little alehouse,
An ay thae southron blades to see.’
7
She’s put her hand into her pouch,
An counted him out pennies three;
‘If ever I live to come back this way,
Weel paid the money it shall be.’
8
He’s taen a staff into his hand,
An leand himsel outowre a tree,
An he’s awa to yon little alehouse,
An ay the southron louns to see.
9
When he gaed in to that little alehouse,
He bad his bennison be there;
The captain answered him [in] wrath,
He answerd him with domineer.
10
‘O whare was ye born, ye crooked auld carle?
An how may this your dwellin be?’
‘O I was born in fair Scotland,
A crooked carle altho I be.’
11
‘O I would een gie twenty shillins
To ony sic crooked carle as thee
That wad find me out Gude Wallace;
For ay that traitor I lang to see.’
12
‘Haud out your hand,’ quo Gude Wallace,
‘I doubt your money be not gude;
If ye’ll gie ither twenty shillins,
It neer shall bide ye anither bode.’
13
He’s taen the captain outowre the jaws,
Anither word spak he neer mair;
An five he sticket whare they sat,
The rest lay scramblin here an there.
14
‘Get up, get up, gudewife,’ he says,
‘An get some meat ready for me,
For I hae fasted this three lang days;
A wat right hungry I may be.’
15
The meat it wasna weel made ready,
Nor as weel on the table set,
Till there cam fyfteen Englishmen
An lighted a’about the yett.
16
The gudewife ran but, the gudeman ran ben;
It put them a’in sic a stoure
That five he sticket whare they sat,
An five lay sprawlin at the door.
17
An five are to the greenwood gane,
An he’s hangd them a’outowre a tree,
An before the mornin twal o clock
He dined wi his men at Loch Marie.
E
Communicated to James Telfer by A. Fisher, as written down from
the mouth of a serving-man, who had learned it in the neighborhood
of Lochmaben. Mr Robert White’s papers.
1
Willie Wallace the water lap,
And lighted low down in a glen;
There he came to a woman washing,
And she had washers nine or ten.
2
‘O weel may ye wash!’ said Willie Wallace,
‘O weel may ye wash!’ said fair Willie,
‘And gin ye have any tidings to tell,
I pray ye tell them unto me.’
3
‘I have nae tidings for to tell,
And as few will I let ye ken;
But down into yon hosteler-ha
Lies fifteen English gentlemen.’
4
‘O had I ae penny in my pocket,
Or had I yet ane bare bawbee,
I would go to yon hosteler-ha,
All for these Englishmen to see.
5
‘O wil ye len me ane pennie,
Or will ye len me a bare bawbee,
I would go to yon hosteler-ha,
All for these Englishmen to see.’
6
She’s put her hand into her pocket,
And she’s gaen him out guineas three,
And he’s away to yon ostler-ha,
All for these Englishmen to see.
7
Before he came to the hosteler-ha,
He linkit his armour oer a tree;
These Englishmen, being weel book-learned,
They said to him, Great Dominie!
8
Where was ye born, ye crookit carle?
Where was ye born, or in what countrie?
‘In merry Scotland I was born,
A crookit carle altho I be.’
9
‘Here’s fifteen shillings,’ one of them said,
‘Here’s other fifteen I’ll gie to thee,
If you will tell me where the traitor Willie Wallace is,
Or where away thou thinks he’ll be.’
10
‘Pay down, pay down your money,’ he said,
‘Pay down, pay down richt speedilie,
For if your answer be not good,
You shall have the downfall of Robin Hood,’ [said he].
11
He struck the captain on the jaw,
He swore that he would chow nae mair cheese;
He’s killed all the rest with his good broad-sword,
And left them wallowing on their knees.
12
‘Go cover the table,’ said Willie Wallace,
‘Go cover the table, get me some meat,
For it is three days and rather mair
Since I did either drink or eat.’
13
They had not the table weel covered,
Nor yet the candle weel gaen licht,
Till fifteen other Englishmen
They a’down at the door did light.
14
‘Come out, come out, Willie Wallace,’ they said.
‘Come out, come out, and do not flee,
For we have sworn by our good broadswords
That this is the nicht that you sall dee.’
15
He’s killed five with his good broadsword,
He’s drowned other five in the raging sea,
And he’s taen other five to the merry greenwood,
And hanged them oer the highest tree.
F
Buchan’s Gleanings, p. 114; from a gypsy tinker, p. 199.
1
Wallace in the high highlans,
Neither meat nor drink got he;
Said, Fa me life, or fa me death,
Now to some town I maun be.
2
He’s put on his short claiding,
And on his short claiding put he;
Says, Fa me life, or fa me death,
Now to Perth-town I maun be.
3
He steped oer the river Tay,
I wat he steped on dry land;
He was aware of a well-fared maid,
Was washing there her lilie hands.
4
‘What news, what news, ye well-fared maid?
What news hae ye this day to me?’
‘No news, no news, ye gentle knight,
No news hae I this day to thee,
But fifteen lords in the hostage-house
Waiting Wallace for to see.’
5
‘If I had but in my pocket
The worth of one single pennie,
I would go to the hostage-house,
And there the gentlemen to see.’
6
She put her hand in her pocket,
And she has pulld out half-a-crown;
Says, Take ye that, ye belted knight,
‘Twill pay your way till ye come down.
pay you ay t ye co e do
7
As he went from the well-fared maid,
A beggar bold I wat met he,
Was coverd wi a clouted cloak,
And in his hand a trusty tree.
8
‘What news, what news, ye silly auld man?
What news hae ye this day to gie?’
‘No news, no news, ye belted knight,
No news hae I this day to thee,
But fifteen lords in the hostage-house
Waiting Wallace for to see.’
9
‘Ye’ll lend me your clouted cloak,
That covers you frae head to shie,
And I’ll go to the hostage-house,
Asking there for some supplie.’
10
Now he’s gone to the West-muir wood,
And there he’s pulld a trusty tree;
And then he’s on to the hostage gone,
Asking there for charitie.
11
Down the stair the captain comes,
Aye the poor man for to see:
‘If ye be a captain as good as ye look,
Ye’ll give a poor man some supplie;
If ye be a captain as good as ye look,
A guinea this day ye’ll gie to me.’
12
‘Where were ye born, ye crooked carle?
e e e e ye bo , ye c oo ed ca e
Where were ye born, in what countrie?’
‘In fair Scotland I was born,
Crooked carle that I be.’
13
‘I would give you fifty pounds,
Of gold and white monie,
I would give you fifty pounds,
If the traitor Wallace ye’d let me see.’
14
‘Tell down your money,’ said Willie Wallace,
‘Tell down your money, if it be good;
I’m sure I have it in my power,
And never had a better bode.
15
‘Tell down your money,’ said Willie Wallace,
‘And let me see if it be fine;
I’m sure I have it in my power
To bring the traitor Wallace in.’
16
The money was told on the table,
Silver bright of pounds fiftie;
‘Now here I stand,’ said Willie Wallace,
‘And what hae ye to say to me? ’
17
He slew the captain where he stood,
The rest they did quack an roar;
He slew the rest around the room,
And askd if there were any more.
18
‘Come, cover the table,’ said Willie Wallace,
‘Come, cover the table now, make haste;
Co e, co e t e tab e o , a e aste;
For it will soon be three lang days
Sin I a bit o meat did taste.’
19
The table was not well covered,
Nor yet was he set down to dine,
Till fifteen more of the English lords
Surrounded the house where he was in.
20
The guidwife she ran but the floor,
And aye the guidman he ran ben;
From eight o clock till four at noon
He has killd full thirty men.
21
He put the house in sick a swither
That five o them he sticket dead,
Five o them he drownd in the river,
And five hung in the West-muir wood.
22
Now he is on to the North-Inch gone,
Where the maid was washing tenderlie;
‘Now by my sooth,’ said Willie Wallace,
‘It’s been a sair day’s wark to me.’
23
He’s put his hand in his pocket,
And he has pulld out twenty pounds;
Says, Take ye that, ye weel-fared maid,
For the gude luck of your half-crown.
G
The Thistle of Scotland, Alexander Laing, p. 100, from the
repetition of an old gentlewoman in Aberdeenshire. Also
Motherwell’s MS., p. 487, communicated by Peter Buchan of
Peterhead, “who had it from an old woman in that neighborhood.”
1
Woud ye hear of William Wallace,
An sek him as he goes,
Into the lan of Lanark,
Amang his mortel faes?
2
There was fyften English sogers
Unto his ladie cam,
Said, Gie us William Wallace,
That we may have him slain.
3
Woud ye gie William Wallace,
That we may have him slain,
And ye’s be wedded to a lord,
The best in Christendeem.
4
‘This verra nicht at seven,
Brave Wallace will come in,
And he’ll come to my chamber-door,
Without or dread or din.’
5
The fyften English sogers
Around the house did wait,
And four brave southron foragers
Stood hie upon the gait.
6
That verra nicht at seven
Brave Wallace he came in,
And he came to his ladie’s bouir,
Withouten dread or din.
7
When she beheld him Wallace,
She star’d him in the face;
‘Ohon, alas!’ said that ladie,
‘This is a woful case.
8
‘For I this nicht have sold you,
This nicht you must be taen,
And I’m to be wedded to a lord,
The best in Christendeem.’
9
‘Do you repent,’ said Wallace,
‘The ill you’ve dane to me?’
‘Ay, that I do,’ said that ladie,
‘And will do till I die.
10
‘Ay, that I do,’ said that ladie,
‘And will do ever still,
And for the ill I’ve dane to you,
Let me burn upon a hill.’
11
Now God forfend,’ says brave Wallace,
‘I shoud be so unkind;
Whatever I am to Scotland’s faes,
I’m aye a woman’s friend.
12
‘Will ye gie me your gown, your gown,
Your gown but and your kirtle,
Your petticoat of bonny brown,
And belt about my middle?
13
‘I’ll take a pitcher in ilka hand,
And do me to the well;
They’ll think I’m one of your maidens,
Or think it is yoursell.’
14
She has gien him her gown, her gown,
Her petticoat and kirtle,
Her broadest belt, wi silver clasp,
To bind about his middle.
15
He’s taen a pitcher in ilka hand,
And dane him to the well;
They thought him one of her maidens,
They kend it was nae hersell.
16
Said one of the southron foragers,
See ye yon lusty dame?
I woud nae gie muckle to thee, neebor,
To bring her back agen.
17
Then all the southrons followd him,
And sure they were but four;
But he has drawn his trusty brand,
And slew them pair by pair.
18
He threw the pitchers frae his hands,
And to the hills fled he,
Until he cam to a fair may,
Was washin on yon lea.
19
‘What news, what news, ye weel-far’d may?
What news hae ye to gie?’
‘Ill news, ill news,’ the fair may said,
‘Ill news I hae to thee.
20
‘There is fyften English sogers
Into that thatched inn,
Seeking Sir William Wallace;
I fear that he is slain.’
21
‘Have ye any money in your pocket?
Pray lend it unto me,
And when I come this way again,
Repaid ye weel shall be.’
22
Sheś put her hand in her pocket,
And taen out shillings three;
He turnd him right and round about,
And thankd the weel-far’d may.
23
He had not gone a long rig length,
A rig length and a span,
Until he met a bold beggar,
As sturdy as coud gang.
24
‘What news, what news, ye bold beggar?
What news hae ye to gie?’
‘O heavy news,’ the beggar said,
‘I hae to tell to thee.
25
‘There is fyften English sogers,
I heard them in yon inn,
Vowing to kill him Wallace;
I fear the chief is slain.’
26
‘Will ye change apparell wi me, auld man?
Change your apparell for mine?
And when I come this way again,
Ye’ll be my ain poor man.’
27
When he got on the beggar’s coat,
The pike-staff in his hand,
He’s dane him down to yon tavern,
Where they were drinking wine.
28
‘What news, what news, ye staff-beggar?
What news hae ye to gie?’
‘I hae nae news, I heard nae news,
As few I’ll hae frae thee.’
29
‘I think your coat is ragged, auld man;
But woud you wages win,
And tell where William Wallace is,
We’ll lay gold in your hand.’
30
‘Tell down, tell down your good red gold,
Upon the table-head,
And ye sall William Wallace see,
Wi the down-come of Robin Hood.’
31
They had nae tauld the money down,
And laid it on his knee,
When candles, lamps, and candlesticks,
He on the floor gard flee.
32
And he has drawn his trusty brand,
And slew them one by one,
Then sat down at the table-head,
And called for some wine.
33
The goodwife she ran but, ran but,
The goodman he ran ben,
The verra bairns about the fire
Were a’like to gang brain.
34
‘Now if there be a Scotsman here,
He’ll come and drink wi me;
But if there be an English loun,
It is his time to flee.’
35
The goodman was an Englishman,
And to the hills he ran;
The goodwife was a Scots woman,
And she came to his hand.