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

Learning pandas Python Data Discovery and Analysis Made Easy Heydt Michael pdf download

The document is about 'Learning pandas', a comprehensive guide authored by Michael Heydt, focusing on the pandas library for data manipulation and analysis in Python. It covers installation, data structures, data access, and visualization techniques, making it suitable for both beginners and experienced users. The book aims to simplify data discovery and analysis using pandas, providing practical examples and insights throughout.

Uploaded by

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

Learning pandas Python Data Discovery and Analysis Made Easy Heydt Michael pdf download

The document is about 'Learning pandas', a comprehensive guide authored by Michael Heydt, focusing on the pandas library for data manipulation and analysis in Python. It covers installation, data structures, data access, and visualization techniques, making it suitable for both beginners and experienced users. The book aims to simplify data discovery and analysis using pandas, providing practical examples and insights throughout.

Uploaded by

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

Learning pandas Python Data Discovery and

Analysis Made Easy Heydt Michael pdf download

https://ebookmeta.com/product/learning-pandas-python-data-
discovery-and-analysis-made-easy-heydt-michael/

Download more ebook from https://ebookmeta.com


[1]
Learning pandas

Get to grips with pandas—a versatile


and high-performance Python library for
data manipulation, analysis, and discovery

Michael Heydt

BIRMINGHAM - MUMBAI
Learning pandas

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: April 2015

Production reference: 1090415

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78398-512-8

www.packtpub.com
Credits

Author Project Coordinator


Michael Heydt Mary Alex

Reviewers Proofreaders
Bill Chambers Simran Bhogal
S. Shelly Jang Paul Hindle
Arun Karunagath Rajeevan Linda Morris
Daniel Velkov Christopher Smith
Adrian Wan
Indexer
Commissioning Editor Monica Ajmera Mehta
Kartikey Pandey
Graphics
Acquisition Editor Sheetal Aute
Neha Nagwekar
Production Coordinator
Content Development Editor Arvindkumar Gupta
Akshay Nair
Cover Work
Technical Editors Arvindkumar Gupta
Shashank Desai
Chinmay Puranik

Copy Editors
Roshni Banerjee
Pranjali Chury
Stuti Srivastava
About the Author

Michael Heydt is an independent consultant, educator, and trainer with nearly


30 years of professional software development experience, during which he focused
on agile software design and implementation using advanced technologies in
multiple verticals, including media, finance, energy, and healthcare. He holds an MS
degree in mathematics and computer science from Drexel University and an executive
master's of technology management degree from the University of Pennsylvania's
School of Engineering and Wharton Business School. His studies and research
have focused on technology management, software engineering, entrepreneurship,
information retrieval, data sciences, and computational finance. Since 2005, he
has been specializing in building energy and financial trading systems for major
investment banks on Wall Street and for several global energy trading companies,
utilizing .NET, C#, WPF, TPL, DataFlow, Python, R, Mono, iOS, and Android. His
current interests include creating seamless applications using desktop, mobile, and
wearable technologies, which utilize high concurrency, high availability, real-time
data analytics, augmented and virtual reality, cloud services, messaging, computer
vision, natural user interfaces, and software-defined networks. He is the author of
numerous technology articles, papers, and books (Instant Lucene.NET, Learning
pandas). He is a frequent speaker at .NET users' groups and various mobile and cloud
conferences, and he regularly delivers webinars on advanced technologies.
About the Reviewers

Bill Chambers is a Python developer and data scientist currently pursuing a


master of information management and systems degree at the UC Berkeley School
of Information. Previously, he focused on data architecture and systems using
marketing, sales, and customer analytics data. Bill is passionate about delivering
actionable insights and innovative solutions using data.

You can find more information about him at http://www.billchambers.me.

S. Shelly Jang received her PhD degree in electrical engineering from the
University of Washington and a master's degree in chemical and biological
engineering from the University of British Columbia in 2014 and 2009, respectively.
She was an Insight Data Science fellow in 2014. During her tenure, she built a
web app that recommends crowd-verified treatment options for various medical
conditions. She is currently a senior data scientist at AT&T Big Data. Exploring
complex, large-scale data sets to build models and derive insights is just a part
of her job.

In her free time, she participates in the Quantified Self community, sharing her
insights on personal analytics and self-hacking.

Arun Karunagath Rajeevan is a senior consultant (products) in an exciting


start-up, working as an architect and coder, and is a polyglot. He is currently
involved in developing the best quality management suite in the supply chain
management category.

Apart from this, he has experience in healthcare and multimedia (embedded)


domains. When he is not working, he loves to travel and listen to music.
Daniel Velkov is a software engineer based in San Francisco, who has more than
10 years of programming experience. His biggest professional accomplishment
was designing and implementing the search stack for MyLife.com—one of the
major social websites in the US. Nowadays, he works on making Google search
better. Besides Python and search, he has worked on several machine learning and
data analysis-oriented projects. When he is not coding, he enjoys skiing, riding
motorcycles, and exploring the Californian outdoors.

Adrian Wan is a physics and computer science major at Swarthmore College. After
he graduates, he will be working at Nest, a Google company, as a software engineer
and data scientist. His passion lies at the intersection of his two disciplines, where
elegant mathematical models and explanations of real-life phenomena are brought to
life and probed deeply with efficient, clean, and powerful code. He greatly enjoyed
contributing to this book and hopes that you will be able to appreciate the power
that pandas brings to Python.

You can find out more about him at http://awan1.github.io.


www.PacktPub.com

Support files, eBooks, discount offers, and more


For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get in
touch with us at service@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Table of Contents
Preface vii
Chapter 1: A Tour of pandas 1
pandas and why it is important 2
pandas and IPython Notebooks 3
Referencing pandas in the application 5
Primary pandas objects 6
The pandas Series object 6
The pandas DataFrame object 11
Loading data from files and the Web 18
Loading CSV data from files 18
Loading data from the Web 22
Simplicity of visualization of pandas data 24
Summary 25
Chapter 2: Installing pandas 27
Getting Anaconda 28
Installing Anaconda 29
Installing Anaconda on Linux 30
Installing Anaconda on Mac OS X 32
Installing Anaconda on Windows 33
Ensuring pandas is up to date 35
Running a small pandas sample in IPython 38
Starting the IPython Notebook server 39
Installing and running IPython Notebooks 43
Using Wakari for pandas 45
Summary 47

[i]
Table of Contents

Chapter 3: NumPy for pandas 49


Installing and importing NumPy 50
Benefits and characteristics of NumPy arrays 50
Creating NumPy arrays and performing basic array operations 52
Selecting array elements 58
Logical operations on arrays 59
Slicing arrays 61
Reshaping arrays 65
Combining arrays 70
Splitting arrays 73
Useful numerical methods of NumPy arrays 79
Summary 82
Chapter 4: The pandas Series Object 83
The Series object 84
Importing pandas 85
Creating Series 85
Size, shape, uniqueness, and counts of values 91
Peeking at data with heads, tails, and take 93
Looking up values in Series 95
Alignment via index labels 100
Arithmetic operations 102
The special case of Not-A-Number (NaN) 106
Boolean selection 107
Reindexing a Series 110
Modifying a Series in-place 117
Slicing a Series 119
Summary 126
Chapter 5: The pandas DataFrame Object 127
Creating DataFrame from scratch 128
Example data 132
S&P 500 133
Monthly stock historical prices 135
Selecting columns of a DataFrame 136
Selecting rows and values of a DataFrame using the index 142
Slicing using the [] operator 142
Selecting rows by index label and location: .loc[] and .iloc[] 143
Selecting rows by index label and/or location: .ix[] 145
Scalar lookup by label or location using .at[] and .iat[] 146
Selecting rows of a DataFrame by Boolean selection 146

[ ii ]
Table of Contents

Modifying the structure and content of DataFrame 148


Renaming columns 148
Adding and inserting columns 150
Replacing the contents of a column 153
Deleting columns in a DataFrame 154
Adding rows to a DataFrame 157
Appending rows with .append() 157
Concatenating DataFrame objects with pd.concat() 159
Adding rows (and columns) via setting with enlargement 165
Removing rows from a DataFrame 166
Removing rows using .drop() 166
Removing rows using Boolean selection 168
Removing rows using a slice 169
Changing scalar values in a DataFrame 170
Arithmetic on a DataFrame 172
Resetting and reindexing 176
Hierarchical indexing 179
Summarized data and descriptive statistics 185
Summary 191
Chapter 6: Accessing Data 193
Setting up the IPython notebook 194
CSV and Text/Tabular format 194
The sample CSV data set 194
Reading a CSV file into a DataFrame 195
Specifying the index column when reading a CSV file 196
Data type inference and specification 196
Specifying column names 197
Specifying specific columns to load 198
Saving DataFrame to a CSV file 199
General field-delimited data 200
Handling noise rows in field-delimited data 201
Reading and writing data in an Excel format 204
Reading and writing JSON files 207
Reading HTML data from the Web 208
Reading and writing HDF5 format files 211
Accessing data on the web and in the cloud 213
Reading and writing from/to SQL databases 214
Reading data from remote data services 217
Reading stock data from Yahoo! and Google Finance 218
Retrieving data from Yahoo! Finance Options 219
Reading economic data from the Federal Reserve Bank of St. Louis 222
Accessing Kenneth French's data 225
Reading from the World Bank 226
Summary 234
[ iii ]
Table of Contents

Chapter 7: Tidying Up Your Data 235


What is tidying your data? 236
Setting up the IPython notebook 237
Working with missing data 237
Determining NaN values in Series and DataFrame objects 239
Selecting out or dropping missing data 241
How pandas handles NaN values in mathematical operations 246
Filling in missing data 248
Forward and backward filling of missing values 250
Filling using index labels 251
Interpolation of missing values 252
Handling duplicate data 255
Transforming Data 259
Mapping 259
Replacing values 261
Applying functions to transform data 264
Summary 269
Chapter 8: Combining and Reshaping Data 271
Setting up the IPython notebook 272
Concatenating data 272
Merging and joining data 281
An overview of merges 281
Specifying the join semantics of a merge operation 286
Pivoting 289
Stacking and unstacking 290
Stacking using nonhierarchical indexes 291
Unstacking using hierarchical indexes 293
Melting 298
Performance benefits of stacked data 299
Summary 300
Chapter 9: Grouping and Aggregating Data 303
Setting up the IPython notebook 304
The split, apply, and combine (SAC) pattern 304
Split 306
Data for the examples 306
Grouping by a single column's values 307
Accessing the results of grouping 308
Grouping using index levels 314
Apply 318
Applying aggregation functions to groups 318

[ iv ]
Table of Contents

The transformation of group data 322


An overview of transformation 322
Practical examples of transformation 326
Filtering groups 333
Discretization and Binning 335
Summary 341
Chapter 10: Time-series Data 343
Setting up the IPython notebook 344
Representation of dates, time, and intervals 345
The datetime, day, and time objects 345
Timestamp objects 347
Timedelta 349
Introducing time-series data 350
DatetimeIndex 350
Creating time-series data with specific frequencies 357
Calculating new dates using offsets 359
Date offsets 360
Anchored offsets 364
Representing durations of time using Period objects 366
The Period object 366
PeriodIndex 368
Handling holidays using calendars 372
Normalizing timestamps using time zones 373
Manipulating time-series data 379
Shifting and lagging 379
Frequency conversion 383
Up and down resampling 386
Time-series moving-window operations 391
Summary 395
Chapter 11: Visualization 397
Setting up the IPython notebook 398
Plotting basics with pandas 399
Creating time-series charts with .plot() 400
Adorning and styling your time-series plot 404
Adding a title and changing axes labels 404
Specifying the legend content and position 406
Specifying line colors, styles, thickness, and markers 408
Specifying tick mark locations and tick labels 412
Formatting axes tick date labels using formatters 415
Common plots used in statistical analyses 421
Bar plots 422

[v]
Table of Contents

Histograms 424
Box and whisker charts 427
Area plots 428
Scatter plots 430
Density plot 432
The scatter plot matrix 433
Heatmaps 435
Multiple plots in a single chart 436
Summary 440
Chapter 12: Applications to Finance 441
Setting up the IPython notebook 442
Obtaining and organizing stock data from Yahoo! 442
Plotting time-series prices 447
Plotting volume-series data 449
Calculating the simple daily percentage change 451
Calculating simple daily cumulative returns 453
Resampling data from daily to monthly returns 455
Analyzing distribution of returns 457
Performing a moving-average calculation 460
The comparison of average daily returns across stocks 461
The correlation of stocks based on the daily percentage
change of the closing price 465
Volatility calculation 467
Determining risk relative to expected returns 468
Summary 471
Index 473

[ vi ]
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of The Night-
Side of Nature; Or, Ghosts and Ghost-Seers
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The Night-Side of Nature; Or, Ghosts and Ghost-Seers

Author: Catherine Crowe

Release date: April 10, 2017 [eBook #54532]


Most recently updated: October 23, 2024

Language: English

Credits: E-text prepared by Delphine Lettau, Cindy Beyer, and


the online Distributed Proofreaders Canada team
(http://www.pgdpcanada.net)

*** START OF THE PROJECT GUTENBERG EBOOK THE NIGHT-SIDE


OF NATURE; OR, GHOSTS AND GHOST-SEERS ***
The Project Gutenberg eBook, The Night-Side of Nature, by
Catherine Crowe

THE

N I G H T- S I D E O F N AT U R E

OR,

GHOSTS AND GHOST-SEERS.

BY

C AT H E R I N E C R O W E

AUTHORESS OF “SUSAN HOPLEY,” “LILLY DAWSON,” “ARISTODEMUS,” ETC.

"Thou com’st in such a questionable shape,


That I will speak to thee.”
NEW YORK:
J. S. REDFIELD, CLINTON HALL.
B O S T O N :— B . B . M U S S E Y & C O .
1850.

PREFACE.

In my late novel of “Lilly Dawson,” I announced my intention of


publishing a work to be called “The Night-Side of Nature;" this is it.
The term “Night-Side of Nature” I borrow from the Germans, who
derive it from the astronomers, the latter denominating that side of
a planet which is turned from the sun, its night-side. We are in this
condition for a certain number of hours out of every twenty-four;
and as, during this interval, external objects loom upon us but
strangely and imperfectly, the Germans draw a parallel between
these vague and misty perceptions, and the similar obscure and
uncertain glimpses we get of that veiled department of nature, of
which, while comprising as it does, the solution of questions
concerning us more nearly than any other, we are yet in a state of
entire and wilful ignorance. For science, at least science in this
country, has put it aside as beneath her notice, because new facts
that do not fit into old theories are troublesome, and not to be
countenanced.
We are encompassed on all sides by wonders, and we can
scarcely set our foot upon the ground, without trampling upon some
marvellous production that our whole life and all our faculties would
not suffice to comprehend. Familiarity, however, renders us
insensible to the ordinary works of nature; we are apt to forget the
miracles they comprise, and even, sometimes, mistaking words for
conceptions, commit the error of thinking we understand their
mystery. But there is one class of these wonders with which, from
their comparatively rare occurrence, we do not become familiar; and
these, according to the character of the mind to which they are
presented, are frequently either denied as ridiculous and impossible,
or received as evidences of supernatural interference—interruptions
of those general laws by which God governs the universe; which
latter mistake arises from our only seeing these facts without the
links that connect them with the rest of nature, just as in the faint
light of a starlit night we might distinguish the tall mountains that lift
their crests high into the sky, though we could not discern the low
chain of hills that united them with each other.
There are two or three books by German authors, entitled “The
Night-Side,” or “The Night-Dominion of Nature,” which are on
subjects, more or less analogous to mine. Heinrick Schubert’s is the
most celebrated among them; it is a sort of cosmogony of the world,
written in a spirit of philosophical mysticism—too much so for
English readers in general.
In undertaking to write a book on these subjects myself, I wholly
disclaim the pretension of teaching or of enforcing opinions. My
object is to suggest inquiry and stimulate observation, in order that
we may endeavor, if possible, to discover something regarding our
psychical nature, as it exists here in the flesh; and as it is to exist
hereafter, out of it.
If I could only induce a few capable persons, instead of laughing
at these things, to look at them, my object would be attained, and I
should consider my time well spent.

CONTENTS.
CHAPTER PAGE

I. — Introduction 7
II. — The Dwellers in the Temple 19
III. — Waking and Sleeping, and how the Dweller in the
Temple sometimes looks abroad 29
IV. — Allegorical Dreams, Presentiments, &c. 48
V. — Warnings 66
VI. — Double Dreaming and Trance, Wraiths, &c. 98
VII. — Wraiths 130
VIII. — Doppelgängers, or Doubles 149
IX. — Apparitions 171
X. — The Future that awaits us 204
XI. — The Power of Will 238
XII. — Troubled Spirits 252
XIII. — Haunted Houses 273
XIV. — Spectral Lights, and Apparitions attached to
Certain Families 319
XV. — Apparitions seeking the Prayers of the Living 345
XVI. — The Poltergeist of the Germans, and Possession 376
XVII. — Miscellaneous Phenomena 411
XVIII. — Conclusion 434

THE
N I G H T- S I D E O F
N AT U R E .
CHAPTER I.
INTRODUCTION.

“Know ye not that ye are the Temple of God, and that the Spirit of God dwelleth in
you?”
—1 Corinthians, iii. 16.

Most persons are aware that the Greeks and Romans entertained
certain notions regarding the state of the soul, or the immortal part
of man, after the death of the body, which have been generally held
to be purely mythological. Many of them doubtless are so, and of
these I am not about to treat; but among their conceptions, there
are some which, as they coincide with the opinions of many of the
most enlightened persons of the present age, it may be desirable to
consider more closely. I allude here particularly to their belief in the
tripartite kingdom of the dead. According to this system, there were
the Elysian fields, a region in which a certain sort of happiness was
enjoyed; and Tartarus, the place of punishment for the wicked; each
of which was, comparatively, but thinly inhabited. But there was also
a mid-region, peopled with innumerable hosts of wandering and
mournful spirits, who, although undergoing no torments, are
represented as incessantly bewailing their condition, pining for the
life they once enjoyed in the body, longing after the things of the
earth, and occupying themselves with the same pursuits and objects
as had formerly constituted their business or their pleasure. Old
habits are still dear to them, and they can not snap the link that
binds them to the earth.
Now, although we can not believe in the existence of Charon, the
three-headed dog, or Alecto, the serpent-haired fury, it may be
worth while to consider whether the persuasion of the ancients with
regard to that which concerns us all so nearly—namely, the destiny
that awaits us when we have shaken off this mortal coil—may not
have some foundation in truth: whether it might not be a remnant of
a tradition transmitted from the earliest inhabitants of the earth,
wrested by observation from nature, if not communicated from a
higher source: and also whether circumstances of constant
recurrence in all ages and in all nations, frequently observed and
recorded by persons utterly ignorant of classical lore, and
unacquainted, indeed, with the dogmas of any creed but their own,
do not, as well as various passages in the Scriptures, afford a
striking confirmation of this theory of a future life; while it, on the
other hand, offers a natural and convenient explanation of their
mystery.
To minds which can admit nothing but what can be explained
and demonstrated, an investigation of this sort must appear
perfectly idle: for while, on the one hand, the most acute intellect or
the most powerful logic can throw little light on the subject, it is, at
the same time—though I have a confident hope that this will not
always be the case—equally irreducible within the present bounds of
science; meanwhile, experience, observation, and intuition, must be
our principal if not our only guides. Because, in the seventeenth
century, credulity outran reason and discretion; the eighteenth
century, by a natural reaction, threw itself into an opposite extreme.
Whoever closely observes the signs of the times, will be aware that
another change is approaching. The contemptuous skepticism of the
last age is yielding to a more humble spirit of inquiry; and there is a
large class of persons among the most enlightened of the present,
who are beginning to believe that much which they had been taught
to reject as fable, has been, in reality, ill-understood truth.
Somewhat of the mystery of our own being, and of the mysteries
that compass us about, are beginning to loom upon us—as yet, it is
true, but obscurely; and, in the endeavor to follow out the clew they
offer, we have but a feeble light to guide us. We must grope our way
through the dim path before us, ever in danger of being led into
error, while we may confidently reckon on being pursued by the
shafts of ridicule—that weapon so easy to wield, so potent to the
weak, so weak to the wise—which has delayed the births of so many
truths, but never stifled one. The pharisaical skepticism which denies
without investigation, is quite as perilous, and much more
contemptible, than the blind credulity which accepts all that it is
taught without inquiry; it is, indeed, but another form of ignorance
assuming to be knowledge. And by investigation, I do not mean the
hasty, captious, angry notice of an unwelcome fact, that too
frequently claims the right of pronouncing on a question; but the
slow, modest, pains-taking examination, that is content to wait upon
Nature, and humbly follow out her disclosures, however opposed to
preconceived theories or mortifying to human pride. If scientific men
could but comprehend how they discredit the science they really
profess, by their despotic arrogance and exclusive skepticism, they
would surely, for the sake of that very science they love, affect more
liberality and candor. This reflection, however, naturally suggests
another, namely, do they really love science, or is it not too
frequently with them but the means to an end? Were the love of
science genuine, I suspect it would produce very different fruits to
that which we see borne by the tree of knowledge, as it flourishes at
present; and this suspicion is exceedingly strengthened by the
recollection that, among the numerous students and professors of
science I have at different times encountered, the real worshippers
and genuine lovers of it, for its own sake, have all been men of the
most single, candid, unprejudiced, and inquiring minds, willing to
listen to all new suggestions, and investigate all new facts; not bold
and self-sufficient, but humble and reverent suitors, aware of their
own ignorance and unworthiness, and that they are yet but in the
primer of Nature’s works, they do not permit themselves to
pronounce upon her disclosures, or set limits to her decrees. They
are content to admit that things new and unsuspected may yet be
true; that their own knowledge of facts being extremely
circumscribed, the systems attempted to be established on such
uncertain data, must needs be very imperfect, and frequently
altogether erroneous; and that it is therefore their duty, as it ought
to be their pleasure, to welcome as a stranger every gleam of light
that appears in the horizon, let it loom from whatever quarter it may.
But, alas! poor Science has few such lovers! Les beaux yeux de
sa cassette, I fear, are much more frequently the objects of
attraction than her own fair face.
The belief in a God, and in the immortality of what we call the
soul, is common to all nations; but our own intellect does not enable
us to form any conception of either one or the other. All the
information we have on these subjects is comprised in such hints as
the Scripture here and there give us: whatever other conclusions we
draw, must be the result of observation and experience. Unless
founded upon these, the opinion of the most learned theologian or
the most profound student of science that ever lived, is worth no
more than that of any other person. They know nothing whatever
about these mysteries; and all a priori reasoning on them is utterly
valueless. The only way, therefore, of attaining any glimpses of the
truth in an inquiry of this nature, where our intellect can serve us so
little, is to enter on it with the conviction that, knowing nothing, we
are not entitled to reject any evidence that may be offered to us, till
it has been thoroughly sifted, and proved to be fallacious. That the
facts presented to our notice appear to us absurd, and altogether
inconsistent with the notions our intellects would have enabled us to
form, should have no weight whatever in the investigation. Our
intellects are no measure of God Almighty’s designs; and, I must say,
that I do think one of the most irreverent, dangerous, and sinful
things man or woman can be guilty of, is to reject with scorn and
laughter any intimation which, however strangely it may strike upon
our minds, and however adverse it may be to our opinions, may
possibly be showing us the way to one of God’s truths. Not knowing
all the conditions, and wanting so many links of the chain, it is
impossible for us to pronounce on what is probable and consistent,
and what is not; and, this being the case, I think the time is ripe for
drawing attention to certain phenomena, which, under whatever
aspect we may consider them, are, beyond doubt, exceedingly
interesting and curious; while, if the view many persons are
disposed to take of them be the correct one, they are much more
than this. I wish, also, to make the English public acquainted with
the ideas entertained on these subjects by a large proportion of
German minds of the highest order. It is a distinctive characteristic of
the thinkers of that country, that, in the first place, they do think
independently and courageously; and, in the second, that they never
shrink from promulgating the opinions they have been led to form,
however new, strange, heterodox, or even absurd, they may appear
to others. They do not succumb, as people do in this country, to the
fear of ridicule; nor are they in danger of the odium that here
pursues those who deviate from established notions; and the
consequence is, that, though many fallacious theories and untenable
propositions may be advanced, a great deal of new truth is struck
out from the collision; and in the result, as must always be the case,
what is true lives and is established, and what is false dies and is
forgotten. But here, in Britain, our critics and colleges are in such
haste to strangle and put down every new discovery that does not
emanate from themselves, or which is not a fulfilling of the ideas of
the day, but which, being somewhat opposed to them, promises to
be troublesome from requiring new thought to render it intelligible,
that one might be induced to suppose them divested of all
confidence in this inviolable law; while the more important and the
higher the results involved may be, the more angry they are with
those who advocate them. They do not quarrel with a new metal or
a new plant, and even a new comet or a new island stands a fair
chance of being well received; the introduction of a planet appears,
from late events, to be more difficult; while phrenology and
mesmerism testify that any discovery tending to throw light on what
most deeply concerns us, namely, our own being, must be prepared
to encounter a storm of angry persecution. And one of the evils of
this hasty and precipitate opposition is, that the passions and
interests of the opposers become involved in the dispute: instead of
investigators, they become partisans; having declared against it in
the outset, it is important to their petty interests that the thing shall
not be true; and they determine that it shall not, if they can help it.
Hence, these hasty, angry investigations of new facts, and the
triumph with which failures are recorded; and hence the wilful
overlooking of the axiom that a thousand negatives can not
overthrow the evidence of one affirmative experiment. I always
distrust those who have declared themselves strongly in the
beginning of a controversy. Opinions which, however rashly avowed,
may have been honest at first, may have been changed for many a
long day before they are retracted. In the meantime, the march of
truth is obstructed, and its triumph is delayed; timid minds are
alarmed; those who dare not or can not think for themselves, are
subdued; there is much needless suffering incurred, and much good
lost; but the truth goes quietly on its way, and reaches the goal at
last.
With respect to the subjects I am here going to treat of, it is not
simply the result of my own reflections and convictions that I am
about to offer. On the contrary, I intend to fortify my position by the
opinions of many other writers; the chief of whom will, for the
reasons above given, namely, that it is they who have principally
attended to the question, be Germans. I am fully aware that in this
country a very considerable number of persons lean to some of
these opinions, and I think I might venture to assert that I have the
majority on my side, as far as regards ghosts—for it is beyond a
doubt that many more are disposed to believe than to confess—and
those who do confess, are not few. The deep interest with which any
narration of spiritual appearances bearing the stamp, or apparent
stamp, of authenticity is listened to in every society, is one proof
that, though the fear of ridicule may suppress, it can not extinguish
that intuitive persuasion, of which almost every one is more or less
conscious.
I avow, that in writing this book, I have a higher aim than merely
to afford amusement. I wish to engage the earnest attention of my
readers; because I am satisfied that the opinions I am about to
advocate, seriously entertained, would produce very beneficial
results. We are all educated in the belief of a future state, but how
vague and ineffective this belief is with the majority of persons, we
too well know; for although, as I have said above, the number of
those who are what is called believers in ghosts and similar
phenomena is very large, it is a belief that they allow to sit
extremely lightly on their minds. Although they feel that the
evidence from within and from without is too strong to be altogether
set aside, they have never permitted themselves to weigh the
significance of the facts. They are afraid of that bugbear,
Superstition—a title of opprobrium which it is very convenient to
attach to whatever we do not believe ourselves. They forget that
nobody has a right to call any belief superstitious, till he can prove
that it is unfounded. Now, no one that lives can assert that the
reappearance of the dead is impossible; all he has a right to say is,
that he does not believe it; and the interrogation that should
immediately follow this declaration is, “Have you devoted your life to
sifting all the evidence that has been adduced on the other side,
from the earliest periods of history and tradition?” and even though
the answer were in the affirmative, and that the investigation had
been conscientiously pursued, it would be still a bold inquirer that
would think himself entitled to say, the question was no longer open.
But the rashness and levity with which mankind make professions of
believing and disbelieving, are, all things considered, phenomena
much more extraordinary than the most extraordinary ghost-story
that ever was related. The truth is, that not one person in a
thousand, in the proper sense of the word, believes anything; they
only fancy they believe, because they have never seriously
considered the meaning of the word and all that it involves. That
which the human mind can not conceive of, is apt to slip from its
grasp like water from the hand; and life out of the flesh falls under
this category. The observation of any phenomena, therefore, which
enabled us to master the idea, must necessarily be extremely
beneficial; and it must be remembered, that one single thoroughly
well-established instance of the reappearance of a deceased person,
would not only have this effect, but that it would afford a
demonstrative proof of the deepest of all our intuitions, namely, that
a future life awaits us.
Not to mention the modern Germans of eminence, who have
devoted themselves to this investigation, there have been men
remarkable for intellect in all countries, who have considered the
subject worthy of inquiry. Among the rest, Plato, Pliny, and Lucien;
and in our own country, that good old divine, Dr. Henry Moore, Dr.
Johnson, Addison, Isaac Taylor, and many others. It may be objected
that the eternally-quoted case of Nicolai, the bookseller at Berlin,
and Dr. Ferriar’s “Theory of Apparitions,” had not then settled the
question; but nobody doubts that Nicolai’s was a case of disease;
and he was well aware of it himself, as it appears to me, everybody
so afflicted, is. I was acquainted with a poor woman, in Edinburgh,
who suffered from this malady, brought on, I believe, by drinking;
but she was perfectly conscious of the nature of the illusions; and
that temperance and a doctor were the proper exorcists to lay the
spirits. With respect to Dr. Ferriar’s book, a more shallow one was
assuredly never allowed to settle any question; and his own theory
can not, without the most violent straining, and the assistance of
what he calls coincidences, meet even half the cases he himself
adduces. That such a disease, as he describes, exists, nobody
doubts; but I maintain that there are hundreds of cases on record,
for which the explanation does not suffice; and if they have been
instances of spectral illusion, all that remains to be said, is, that a
fundamental reconstruction of the theory on that subject is
demanded.
La Place says, in his “Essay on Probabilities,” that “any case,
however apparently incredible, if it be a recurrent case, is as much
entitled, under the laws of induction, to a fair valuation, as if it had
been more probable beforehand.” Now, no one will deny that the
case in question possesses this claim to investigation. Determined
skeptics may, indeed, deny that there exists any well-authenticated
instance of an apparition; but that, at present, can only be a mere
matter of opinion; since many persons, as competent to judge as
themselves, maintain the contrary; and in the meantime, I arraign
their right to make this objection till they have qualified themselves
to do so, by a long course of patient and honest inquiry; always
remembering that every instance of error or imposition discovered
and adduced, has no positive value whatever in the argument, but
as regards that single instance; though it may enforce upon us the
necessity of strong evidence and careful investigation. With respect
to the evidence, past and present, I must be allowed here to remark
on the extreme difficulty of producing it. Not to mention the
acknowledged carelessness of observers and the alleged incapacity
of persons to distinguish between reality and illusion, there is an
exceeding shyness in most people, who, either have seen, or fancied
they have seen, an apparition, to speak of it at all, except to some
intimate friend; so that one gets most of the stories second-hand;
while even those who are less chary of their communications, are
imperative against their name and authority being given to the
public. Besides this, there is a great tendency in most people, after
the impression is over, to think they may have been deceived; and
where there is no communication or other circumstance rendering
this conviction impossible, it is not difficult to acquire it, or at least
so much of it as leaves the case valueless. The seer is glad to find
this refuge from the unpleasant feelings engendered; while
surrounding friends, sometimes from genuine skepticism, and
sometimes from good-nature, almost invariably lean to this
explanation of the mystery. In consequence of these difficulties and
those attending the very nature of the phenomena, I freely admit
that the facts I shall adduce, as they now stand, can have no
scientific value; they can not in short, enter into the region of
science at all, still less into that of philosophy. Whatever conclusions
we may be led to form, can not be founded on pure induction. We
must confine ourselves wholly within the region of opinion; if we
venture beyond which, we shall assuredly founder. In the beginning,
all sciences have been but a collection of facts, afterward to be
examined, compared, and weighed, by intelligent minds. To the
vulgar, who do not see the universal law which governs the universe,
everything out of the ordinary course of events, is a prodigy; but to
the enlightened mind there are no prodigies; for it perceives that in
both the moral and the physical world, there is a chain of
uninterrupted connection; and that the most strange and even
apparently contradictory or supernatural fact or event will be found,
on due investigation, to be strictly dependent on its antecedents. It
is possible, that there may be a link wanting, and that our
investigations may, consequently, be fruitless; but the link is
assuredly there, although our imperfect knowledge and limited vision
can not find it.
And it is here the proper place to observe, that, in undertaking to
treat of the phenomena in question, I do not propose to consider
them as supernatural; on the contrary, I am persuaded that the time
will come, when they will be reduced strictly within the bounds of
science. It was the tendency of the last age to reject and deny
everything they did not understand; I hope it is the growing
tendency of the present one to examine what we do not understand.
Equally disposed with our predecessors of the eighteenth century to
reject the supernatural, and to believe the order of nature inviolable,
we are disposed to extend the bounds of nature and science, till
they comprise within their limits all the phenomena, ordinary and
extraordinary, by which we are surrounded. Scarcely a month passes
that we do not hear of some new and important discovery in
science. It is a domain in which nothing is stable, and every year
overthrows some of the hasty and premature theories of the
preceding ones; and this will continue to be the case as long as
scientific men occupy themselves each with his own subject, without
studying the great and primal truths—what the French call les
vérités mères—which link the whole together. Meantime, there is a
continual unsettling. Truth, if it do not emanate from an
acknowledged authority, is generally rejected; and error, if it do, is as
often accepted; while, whoever disputes the received theory,
whatever it be—we mean especially that adopted by the professors
of colleges—does it at his peril. But there is a day yet brooding in
the bosom of time, when the sciences will be no longer isolated;
when we shall no longer deny, but be able to account for,
phenomena apparently prodigious, or have the modesty, if we can
not explain them, to admit that the difficulty arises solely from our
own incapacity. The system of centralization in statistics seems to be
of doubtful advantage; but a greater degree of centralization
appears to be very much needed in the domain of science. Some
improvement in this respect might do wonders, particularly if
reinforced with a slight infusion of patience and humility into the
minds of scientific men; together with the recollection that facts and
phenomena, which do not depend on our will, must be waited for—
that we must be at their command, for they will not be at ours.
But to return once more to our own subject. If we do believe that
a future life awaits us, there can be nothing more natural than the
desire to obtain some information as to what manner of life that is to

You might also like