The Python Advantage: Python For Excel in 2024 Hayden Van Der Post PDF Download
The Python Advantage: Python For Excel in 2024 Hayden Van Der Post PDF Download
https://ebookmass.com/product/the-python-advantage-python-for-excel-
in-2024-hayden-van-der-post/
https://ebookmass.com/product/health-analytics-with-python-a-
comprehensive-guide-for-2024-van-der-post/
https://ebookmass.com/product/algorithmic-essentials-trading-with-
python-your-comprehenive-guide-for-2024-van-der-post/
https://ebookmass.com/product/financial-architect-algorithmic-trading-
with-python-a-comprehensive-guide-for-2024-van-der-post/
https://ebookmass.com/product/market-master-trading-with-python-van-
der-post/
Power Trader: Options Trading with Python Van Der Post
https://ebookmass.com/product/power-trader-options-trading-with-
python-van-der-post/
https://ebookmass.com/product/python-fundamentals-for-finance-a-
survey-of-algorithmic-options-trading-with-python-van-der-post/
https://ebookmass.com/product/calculus-for-data-science-hayden-van-
der-post-vincent-bisette/
https://ebookmass.com/product/data-universe-organizational-insights-
with-python-embracing-data-driven-decision-making-van-der-post/
Reactive Publishing
CONTENTS
Title Page
Chapter 1: Introduction to Python for Excel Users
Chapter 2: Python Basics for Spreadsheet Enthusiasts – Enhanced
Chapter 3: Mastering Advanced Excel Techniques with Pandas
Chapter 4: Unraveling Data Analysis and Visualization
Chapter 5: Exploring Integrated Development Environments (IDEs)
Chapter 6: Streamlining Excel Operations with Python Automation
Chapter 7: Bridging Excel with Databases and Web APIs
Additional Resources for Excel
Guide 1 - Essential Excel Functions
Guide 2 - Excel Keyboard Shortcuts
Python Programming Guides
Guide 3 - Python Installation
Step 1: Download Python
Step 2: Run the Installer
Step 3: Installation Setup
Step 4: Verify Installation
Step 5: Install pip (if not included)
Step 1: Download Python
Step 2: Run the Installer
Step 3: Follow Installation Steps
Step 4: Verify Installation
Step 5: Install pip (if not included)
Guide 4 - Create a Budgeting Program in Python
Step 1: Set Up Your Python Environment
Step 2: Create a New Python File
Step 3: Write the Python Script
Step 4: Run Your Program
Step 5: Expand and Customize
Guide 5 - Create a Forecasting Program in Python
Step 1: Set Up Your Python Environment
Step 2: Prepare Your Data
Step 3: Write the Python Script
Step 4: Run Your Program
Step 5: Expand and Customize
Guide 6 - Integrate Python in Excel
Step 1: Set Up Your Python Environment
Step 2: Prepare Your Excel File
Step 3: Write the Python Script
Step 4: Run Your Program
Step 5: Expand and Customize
CHAPTER 1:
INTRODUCTION TO
PYTHON FOR EXCEL
USERS
Understanding the Basics of
Python
I
n today's dynamic world of data analysis, Python has become an
essential tool for those looking to work with and understand extensive
datasets, especially within Excel. To begin this journey effectively, it's
crucial to first understand the core principles that form the foundation of
Python. This understanding is not just about learning a programming
language; it's about equipping yourself with the skills to harness Python's
capabilities in data manipulation and interpretation.
Python's syntax, renowned for its simplicity and readability, is designed to
be easily understandable, mirroring the human language more closely than
many of its programming counterparts. This attribute alone makes it a
worthy companion for Excel users who may not have a background in
computer science.
Variables in Python are akin to cells in an Excel spreadsheet—containers
for storing data values. However, unlike Excel, Python is not confined to
rows and columns; its variables can hold a myriad of data types including
integers, floating-point numbers, strings, and more complex structures like
lists and dictionaries.
Another cornerstone of Python is its dynamic typing system. While Excel
requires a definitive cell format, Python variables can seamlessly transition
between data types, offering a level of flexibility that Excel alone cannot
provide. This fluidity proves invaluable when dealing with diverse datasets.
The Python language also introduces functions, which can be equated to
Excel's formulas, but with far greater potency. Python functions are
reusable blocks of code that can perform a specific task, receive input
parameters, and return a result. They can range from simple operations, like
summing a list of numbers, to complex algorithms that analyze and predict
trends in financial data.
Indentation is a unique aspect of Python's structure that governs the flow of
execution. Similar to the way Excel's formulas rely on the correct order of
operations, Python's blocks of code depend on their hierarchical indentation
to define the sequence in which statements are executed. This clarity in
structure not only aids in debugging but also streamlines the collaborative
review process.
One cannot discuss Python without mentioning its extensive libraries,
which are collections of modules and functions that someone else has
written to extend Python's capabilities. For Excel users, libraries such as
Pandas, NumPy, and Matplotlib open a gateway to advanced data
manipulation, analysis, and visualization options that go well beyond
Excel's native features.
To truly harness the power of Python, one must also understand the concept
of iteration. Loops in Python, such as for and while loops, allow users to
automate repetitive tasks—something that Excel's fill handle or drag-down
formulas could only dream of achieving with the same level of
sophistication.
In conclusion, understanding the basics of Python is akin to learning the
alphabet before composing a symphony of words. It is the essential
foundation upon which all further learning and development will be built.
By mastering these fundamental elements, Excel users can confidently
transition to Python, elevating their data analysis capabilities to new zeniths
of efficiency and insight.
Why Python Is Essential for Excel Users in 2024
As we navigate the digital expanse of 2024, the symbiosis between Python
and Excel has never been more critical. Excel users, standing at the
confluence of data analytics and business intelligence, find themselves in
need of tools that can keep pace with the ever-expanding universe of data.
Python has ascended as the quintessential ally, offering capabilities that
address and overcome the limitations inherent in Excel.
In this dynamic era, data is not merely a static entity confined to
spreadsheets. It is an ever-flowing stream, constantly updated, and requiring
real-time analysis. Python provides the means to automate the extraction,
transformation, and loading (ETL) processes, thus ensuring that Excel users
can maintain an up-to-the-minute view of their data landscapes.
The essence of Python's indispensability lies in its ability to manage large
datasets, which often overwhelm Excel's capabilities. As datasets grow in
size, so do the challenges of processing them within the constraints of
Excel's rows and columns. Python, with its ability to handle big data,
enables users to process information that would otherwise be truncated or
slow to manipulate within Excel.
Moreover, Python's robust libraries, such as Pandas, offer data manipulation
and analysis functions that go well beyond the scope of Excel's built-in
tools. Users can perform complex data wrangling tasks, merge datasets with
ease, and carry out sophisticated statistical analyses—all within an
environment that is both powerful and user-friendly.
The introduction of machine learning and predictive analytics into the
business environment has further solidified Python's role as an essential tool
for Excel users. With libraries such as scikit-learn, TensorFlow, and
PyTorch, Excel users can now harness the power of machine learning to
uncover patterns and insights, predict trends, and make data-driven
decisions with a level of accuracy and foresight that was previously
unattainable.
Visualization is another realm where Python excels. While Excel offers a
variety of charting tools, Python's visualization libraries like Matplotlib,
Seaborn, and Plotly provide a much broader canvas to depict data. These
tools enable users to create interactive, publication-quality graphs and
dashboards that can communicate complex data stories with clarity and
impact.
Python's scripting capabilities allow for the customization and extension of
Excel's functionality. Through the use of add-ins and application
programming interfaces (APIs), Python can automate routine tasks, develop
new functions, and even integrate Excel with other applications and web
services, fostering a seamless flow of information across platforms and
systems.
In the context of 2024, where agility and adaptability are paramount,
Python equips Excel users with the means to refactor their approach to data.
It empowers them to transition from being passive recipients of information
to active architects of innovation. By learning Python, Excel users are not
just staying relevant; they are positioning themselves at the forefront of the
data revolution, ready to leverage the convergence of these two powerful
tools to achieve unprecedented levels of productivity and insight.
In the subsequent sections, we will explore the practical applications of
Python in Excel tasks, providing you with the knowledge and examples
needed to transform your spreadsheets into dynamic engines of analysis and
decision-making.
Setting Up Your Environment: Python and Excel
In the pursuit of mastering Python for Excel, the initial step is to establish a
conducive working environment that bridges both platforms. This section
will guide you through the meticulous process of setting up a robust Python
development environment tailored for Excel integration, ensuring a
seamless workflow that maximizes efficiency and productivity.
Firstly, you'll need to install Python. As of 2024, Python 3.12 remains the
standard, and it's important to download it from the official Python website
to ensure you have the latest version. This will give you access to the most
recent features and security updates. After installation, verify the setup by
running the 'python' command in your terminal or command prompt.
Next, let’s talk about Integrated Development Environments (IDEs). While
Python comes with IDLE as its default environment, there are numerous
other IDEs that offer enhanced features for development, such as PyCharm,
Visual Studio Code, and Jupyter Notebooks. Each IDE has its unique
advantages, and it's vital to choose one that aligns with your workflow
preferences. Jupyter Notebooks, for instance, is particularly favoured by
data scientists for its interactive computing and visualization capabilities.
With the IDE selected, you must install the necessary packages that
facilitate Excel integration. The 'pip' command, Python’s package installer,
is your gateway to these libraries. The most pivotal of these is Pandas,
which provides high-level data structures and functions designed for in-
depth data analysis. Install Pandas using the command 'pip install pandas' to
gain the ability to manipulate Excel files in ways that were previously
unimaginable within Excel itself.
To directly manipulate Excel files, you’ll also need to install the 'openpyxl'
library for handling .xlsx files, or 'xlrd' for working with .xls files. These
libraries can be installed with pip commands such as 'pip install openpyxl'
or 'pip install xlrd'.
Furthermore, to leverage Python's advanced data visualization tools, you
should install Matplotlib and Seaborn, essential for crafting insightful
graphical representations of data. These can be installed with 'pip install
matplotlib' and 'pip install seaborn' respectively.
For those who will be using Python alongside Excel’s macro capabilities,
the 'xlwings' library is a must-have. It allows Python to hook into Excel,
enabling the automation of Excel tasks and the creation of custom user-
defined functions in Python. Install it with 'pip install xlwings'.
Another critical aspect is the Python Excel writer 'xlsxwriter', which lets
you create sophisticated Excel workbooks with advanced formatting, charts,
and even formulas. It can be installed via 'pip install xlsxwriter'.
Once your libraries are installed, it's crucial to test each one by importing it
into your IDE and running a simple command. For example, you could test
Pandas by importing it and reading a sample Excel file into a DataFrame.
This verifies that the installation was successful and that you're ready to
proceed with confidence.
For those who may not be as familiar with command-line installations,
there are graphical user interfaces such as Anaconda, which simplifies
package management and provides a one-stop-shop for all your data science
needs.
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
The key differences between Python and Excel in functionality lie in their
unique strengths and use cases within data analysis. Excel, a spreadsheet
application, excels in data storage, manipulation, and simple analysis. Its
user-friendly grid interface is ideal for data entry and basic calculations.
However, it struggles with complex data processing and automation.
Python, a high-level programming language, excels in advanced data
manipulation, statistical modeling, and handling large-scale data. It
outperforms Excel in flexibility, scalability, and handling large datasets.
Python's extensive libraries enable sophisticated operations, like custom
machine learning models and web API integration, which Excel cannot
offer.
Python's advantage in handling large datasets is significant. It can process
much larger volumes of data compared to Excel's row limit. Python's
customization and automation capabilities surpass Excel's, especially with
its vast ecosystem of libraries.
Excel's formulas are convenient for simple tasks but become cumbersome
for complex analyses. In contrast, Python's syntax, though requiring more
learning, offers readability and maintainability, especially for complex
operations. Python also enables reusability and better organization of code
through functions and classes.
In visualization, Python has the upper hand with libraries like Matplotlib
and Seaborn, offering more variety and customization than Excel's built-in
chart types. Python's error handling is more robust, providing detailed error
messages aiding in debugging, unlike Excel's often challenging error
troubleshooting.
However, Excel's ease of use, familiar interface, and real-time collaboration
features make it irreplaceable for certain tasks, such as quick data entry and
pivot table use.
Integrating Python with Excel is made possible through several libraries,
enhancing Excel's capabilities with Python's analytical strength.
Python vs. VBA: A Deep Dive into Their Strengths and Weaknesses
Python's Superior Versatility and Performance Python stands out as a
high-level, versatile language with clear, intuitive syntax. Its broad
application range extends far beyond Excel, allowing for integration with
various databases and web applications, and excelling in complex statistical
analyses. Python's robust performance across different operating systems
and its efficiency in managing large datasets give it a significant edge over
VBA, especially for tasks surpassing Excel's row limits.
The Robust Ecosystem and Community of Python Python's ecosystem,
enriched with libraries like Pandas, NumPy, and Matplotlib, specifically
caters to data analysis and visualization, offering tools that are essential for
Excel users. The extensive and active Python community provides abundant
resources, documentation, and forums for support, overshadowing VBA's
more niche community.
VBA: The Comfort of Accessibility and Compatibility VBA, integrated
into Microsoft Office applications, offers immediate accessibility to Excel
users, eliminating the need for extra installations. Its direct interaction with
Excel sheets, forms, and controls makes it a convenient choice for small-
scale automation and tasks closely tied to Excel's interface.
Learning Curve and Development Time: A Balanced Perspective
Python might present a steeper learning curve for those without prior
programming experience, yet its syntax facilitates a smoother and quicker
learning process over time. VBA's specialized and less intuitive syntax can
make development faster for simple Excel tasks due to its in-app
integration.
Maintenance and Scalability: Python as the Future-Proof Choice
Python is easier to maintain and scale, with its readable code and cross-
platform functionality, contrasting with VBA's Windows and Microsoft
Office limitations. Python's broader applicability makes it more future-
proof and scalable.
Security and Updates: Python's Progressive Edge Python continuously
integrates the latest security features and best practices, while VBA, as an
older language, may fall short in modern security standards. Microsoft's
increasing investment in Python for Excel indicates Python's growing
preference for future developments.
Python's Extensive Integration Capabilities Python's ability to connect
with various data sources, APIs, and services far surpasses VBA's
integration, mainly confined to Microsoft Office applications. This
capability is crucial for those aiming to broaden their data processing scope.
Conclusion: Python vs. VBA for Excel Users While VBA remains
suitable for straightforward, Excel-focused tasks, Python emerges as the
more powerful, versatile, and forward-looking option. Despite an initial
learning curve, Python's advanced data handling and analysis capabilities
make it an invaluable asset for Excel users seeking to excel in a data-driven
world.
Pandas: A Vital Tool for Data Manipulation in Python
Transitioning to data mastery with Python, one encounters Pandas, a key
library for enhancing data manipulation in conjunction with Excel. This
section explores Pandas' fundamentals and its transformative potential for
data work.
Understanding Pandas: A Data Analysis Catalyst Pandas, born from the
needs of data analysts, is a Python library offering structures and operations
for handling numerical tables and time series. Its name, derived from "Panel
Data," reflects its focus on handling structured, multidimensional data sets.
DataFrames: Pandas' Core Feature The DataFrame, akin to an advanced
Excel spreadsheet, is a mutable, two-dimensional data structure with
labeled axes, capable of processing millions of rows effortlessly. This
feature is central to Pandas' role in data manipulation.
Mastering Data Manipulation with Pandas Pandas streamlines tasks like
merging datasets, pivoting tables, and managing missing data, surpassing
Excel's capabilities. Its I/O functions allow for smooth interaction with
various file formats, enhancing Excel's functionalities.
Sample Pandas Code for Excel Users
python
import pandas as pd
I
n the dynamic world of data management and analysis, a deep
understanding of data types forms the cornerstone. As we embark on a
journey through Python's landscape, recognizing and utilizing its diverse
data types becomes imperative. This becomes particularly salient when
contrasting these with Excel's familiar data types. This section aims to serve
as a comprehensive guide, bridging the gap between Python and Excel data
types, facilitating a seamless transition for those adept in Excel delving into
the Python domain.
Python's data types form the backbone of its versatility. Beginning with the
essentials: integers, floats, strings, and booleans – these are crucial. A
Python integer is comparable to Excel's whole number, sans decimal points.
Floats in Python are akin to Excel's numbers with decimals. Python's strings
are character sequences, mirroring Excel's text format. Booleans in Python
are essential, representing binary truth values – True or False, analogous to
Excel's logical TRUE and FALSE.
Excel aficionados typically organize data using rows and columns. Python
introduces lists and tuples for storing ordered data collections. Lists are
dynamic, allowing post-creation modifications, while tuples remain static.
Envision lists as Excel rows or columns, permitting value alterations or
additions. Tuples resemble a constant set of Excel cells.
DEAN DUNHAM
When the two partners returned to the hotel with the proceeds
of the entertainment in their pockets, they were in high spirits.
"I feel as rich as Vanderbilt," said Montgomery in exultation.
"And I feel like an Astor or a Gould," chimed in Dean. "Peter
Kirby did me a good turn when he discharged me."
"Dean, you are star! I had no idea of your talent."
"Don't flatter me, Mr. Montgomery," said Dean blushing. "You will
make me self-conceited. I was lucky in falling in with you."
"Well said, my boy! I see you don't grudge me my share of the
credit. We will keep on, will we not?"
"As long as there is any money in it."
"Precisely. Your hand on that."
In pursuance of this agreement, three evenings later they gave
an entertainment in the town of Cameron, twenty miles away.
Circumstances were not as favorable, but they divided twenty dollars
net profits.
"We mustn't complain of that, Dean," said his companion. "It
isn't as much, to be sure, as we made at Granville."
"But it seems to me ridiculously large for the little I did, Mr.
Montgomery."
"You are modest, Dean. That is not artistic. You must set a
proper value on your talent."
"I think I do," said Dean, smiling. "I feel very much like a
humbug, Mr. Montgomery. A young lady came up to me last evening
and asked me if I had played before any of the crowned heads of
Europe, and if I were personally acquainted with Queen Victoria."
"I hope you told her you were."
"No, Mr. Montgomery, I shouldn't be willing to tell such a
falsehood."
"All business, my dear boy, all business! We must blow our own
trumpets if we want to be appreciated. By the way, what did you tell
her?"
"That I had not yet played before the queen, but should I go to
England, and could arrange to do so, I would."
"Very good! You kept up appearances. What did she say?"
"She asked me if I would get her Queen Victoria's autograph, in
that case. She also asked me for my own. I promised her the
queen's if I were able to obtain it."
"Didn't she ask for my autograph?" asked Mr. Montgomery, with
a twinge of professional jealousy.
"She said she was going to ask you for it."
"I shall be glad to gratify her," said Montgomery,
condescendingly. "I am often asked for an autograph."
"That was my first application," said Dean smiling.
"You are not as old as I. Long before you are, your autograph
will be in demand."
For three weeks the combination continued to give
entertainments, arranging from two to three a week. They did not
again meet with the success which had greeted them at Granville,
but in almost every case they made expenses, and a fair sum
besides. At the end of this time, each of the partners found himself
possessed of about forty dollars.
At the close of a concert at a small town in Missouri, on
returning to the hotel, Mr. Montgomery chanced to take up a copy of
the New York Herald in the office. He ran over the advertisements on
the first page, including the "Personals," when all at once his color
changed, and he looked agitated.
"What's the matter, Mr. Montgomery?" asked Dean.
"Bad news, my boy!" said the actor sadly. "Look at that!"
Dean read the following among the personals:
"My poor old mother!" said the actor feelingly. "She may be dead
by this time. Why couldn't I have seen this notice before?"
"What is the date of the paper?" asked Dean.
"It is five days old."
"I suppose you will go at once."
"Yes, I must. I never would forgive myself if I did not hurry
home on the chance of seeing the dear old mother once more."
"You are right, Mr. Montgomery. I would do the same if I were
fortunate enough to have a mother living."
"Of course that ends our partnership for the present. Will you go
home with me, Dean?"
Dean shook his head.
"No, I have nothing to go home to. It would take all my money,
and there would be nothing for me to do in Waterford."
"But you can't give entertainments alone."
"I can make my living somehow. I have forty dollars, and that
would last me some time even if I got nothing to do."
When Dean bade his companion good-bye at the station the
next morning, and turned away, a forlorn feeling came over him, and
he felt tempted to take the next train East himself. But the thought
of going back to Waterford as poor as he started, and with no
prospect of employment, braced him up, and he resolved to push on
westward and take his chances. He returned to the hotel, and sat
down to consider his plans.
There a pleasant surprise awaited him.
"There's a gentleman to see you, Mr. Dunham," said the clerk.
"Where is he?" asked Dean.
"He went out to make a call in the village but will be back in
fifteen minutes. This is his card."
Dean took the card in his hand, and read the name
Samuel Gunnison.
"Any acquaintance of yours?" asked the clerk.
"No; I never heard the name."
"I think he wants you to play to-morrow evening. He lives in the
next town, Carterville."
"Mr. Montgomery has been called East. I am afraid this will stop
our entertainments."
"He did not ask for Mr. Montgomery, only for you."
Mr. Gunnison soon came in. He was a slender, dark
complexioned man, with a pleasant face.
"I know you are Dean Dunham," he said, extending his hand,
"for I heard you play last evening. Are you engaged for to-morrow?"
"No, sir."
"Then I should like to engage your services. An entertainment is
to be given in our town hall for the benefit of our town library. For
the most part local talent is employed. We are to have a short play,
and a few songs. I, as manager, have thought it would help us if we
could advertise you in connection with the home attractions."
"I shall be glad to make an engagement," said Dean pleasantly.
"What would be your terms?" asked Mr. Gunnison a little
anxiously.
"How much can you afford to pay me?" asked Dean.
"We would not think of offering a player of your reputation less
than ten dollars if it were not desirable to make expenses as small as
possible, but——"
"Under the circumstances," said Dean, interrupting him, "I will
be willing to come for five."
"Thank you, Mr. Dunham. You are very kind," said Mr. Gunnison,
warmly, grasping our hero by the hand. "I will try to make it up to
you. Instead of going to the hotel you shall be my guest, and your
expenses will be nothing. If you are ready I will take you over at
once. I have a buggy at the door."
"Thank you, sir, I will accept your kind invitation."
So Dean, feeling less lonesome than he did, secured his valise,
and taking a seat beside his new friend, rode in the direction of
Carterville. He was destined to meet an old acquaintance there.
CHAPTER XXV.
AN UNEXPECTED MEETING.
Dr. Thorp had been pleased with Peter Kirby, who had laid
himself out to be agreeable, and the doctor was far from suspecting
his real character. When this was revealed to him by Dean, he
quickly decided to test it for himself.
Some men, inclined to be nervous and timid, would have had
their apprehensions excited, and dreaded an encounter with a
professional criminal. But Dr. Thorp was cool, resolute and
determined. He proposed to facilitate Kirby's designs, and catch him
in a trap.
When he reached home he found Kirby smoking on the piazza.
"Have you been taking a walk, Doctor?" he asked.
"Yes," answered Dr. Thorp. "I made a call on a neighbor. I hope
you have not been lonesome."
"Oh, no! Your daughter has enabled me to pass the time
pleasantly. But I am glad to see you back."
Had Kirby known that Dr. Thorp had had an interview with Dean
Dunham, his anxiety would have been excited.
"By the way, Doctor," said Kirby with apparent carelessness, "I
have a little money to invest. Can you recommend any form of
investment?"
"You might buy a house in the village and settle down. I believe
the next estate is for sale."
"It would certainly be an inducement to become your neighbor,"
said Kirby politely, "but I am a rolling stone. I am always traveling. I
couldn't content myself in any one place, not even in a large city."
"I suspect your mode of life makes frequent removals
necessary," thought Dr. Thorp, though he did not say so.
"Well, if you don't care to invest in real estate," he said a
moment later, "you might purchase government bonds or railroad
securities."
"To which do you give the preference?" asked Kirby.
The doctor smiled inwardly. He saw that Kirby was trying to
ascertain whether he had any negotiable securities in his possession,
but he was ready to play into his hands.
"Well," he said, "I think well of both."
"I had some government bonds at one time," said Kirby, "but
they were stolen. That has made me cautious."
"Perhaps you were careless."
"No doubt I was. I kept them in a trunk at my boarding-house. I
presume you wouldn't venture, even in a quiet village like this, to
keep bonds in your house?"
"Oh, yes, we never receive visits from thieves or burglars. I don't
consider trunks so safe as—that cabinet."
He pointed to a black walnut cabinet with several drawers
standing in one corner of the room.
Kirby's face lighted up. He had got the information he desired,
but he resumed his indifferent manner.
"I think you are right," he said. "Besides, in a town like
Carterville, as you say, thieves are hardly likely to be found."
"Oh, dear, no!" said Dr. Thorp yawning. "I have no occasion to
borrow trouble on that score."
"Living as I generally do in large cities where members of the
criminal class abound," said Kirby, "I am naturally more suspicious
than you. I confess I wish I lived in a place of Arcadian innocence
like this."
Dr. Thorp smiled. He was amused to hear one whom he believed
to be a professional thief discourse in this manner.
"You might find it dull," he said, a little satirically, "It would lack
the spice and excitement of wickedness."
At a little after eleven Kirby signified that he was tired and was
conducted to his bed-chamber. Dr. Thorp remained behind, and
opening the lower drawer of his cabinet removed therefrom a roll of
bank bills and a five hundred dollar government bond.
"I think these will be safe in my trunk to-night," he said to
himself. "Now, Mr. Kirby, you can explore the cabinet at your leisure.
I doubt if you will find enough to repay you for your trouble."
Kirby occupied a chamber just over the sitting-room. He didn't
undress himself, but threw himself on the bed to snatch a little rest.
"I found out very cleverly where the doctor kept his bonds," he
soliloquized. "He is an innocent, unsuspicious man, luckily for me. So
no thieves or burglars ever visit Carterville," he repeated with a soft
laugh. "The good doctor would have been mightily surprised had he
known the character of the man with whom he was talking. It is
hardly a credit to take in a simple-minded man like the doctor. I very
much regret the necessity of repaying his hospitality as I shall, but I
need the bonds more than he does."
Kirby did not allow himself to sleep. There was important work
to be done, and he must not run the risk of oversleeping himself.
He waited impatiently till he heard the public clock strike
midnight, then taking off his shoes descended in his stocking feet to
the sitting-room. There stood the cabinet plainly visible in the
glorious moonlight that flooded the room, making artificial light
unnecessary.
"It's an easy job for a man of my experience to open it," thought
Kirby. "I hope the doctor is sound asleep. He looks like a man who is
safe to sleep all night."
From his pocket he produced a bunch of skeleton keys, which he
at once set himself to use. The lock on the drawer of the cabinet
was a simple one, presenting no difficulty, and in less than five
minutes he opened the upper drawer. A glance satisfied him that it
contained nothing that he could make available. In turn he opened
the other drawers, with equal ill success.
"The doctor must have fooled me!" he muttered impatiently, "or
is there some secret drawer that I have overlooked?"
This question he asked himself, but he was far from expecting
an answer.
"You have examined the cabinet pretty thoroughly Mr. Kirby,"
said a cool, calm voice.
Kirby sprang to his feet in wild dismay. There, looking at him
from the doorway, was Dr. Thorp, his host, whom he was conspiring
to rob.
"You are an early riser, are you not, Mr. Kirby?" said the doctor
composedly.
Kirby quickly decided upon his course.
"Where am I?" he asked, passing his hand over his face in a
bewildered way.
"Where are you? Don't you recognize the room? A more
pertinent query would be, 'What are you doing?'"
"Good Heavens!" ejaculated Kirby—"I—I see it now. That
unfortunate habit of walking in my sleep! What can you think of
me?"
"Do you generally carry skeleton keys about with you when you
walk in your sleep, Mr. Kirby?" asked the doctor pointedly.
"I—I really don't know how to explain," stammered Kirby. "These
keys I found in my room on the morning after I was robbed. I took
them with me, thinking they might be of use if I should lose my
regular keys."
"Very ingeniously explained, upon my word!"
"It isn't possible, Dr. Thorp, that you really take me for a thief! I
hope you have more confidence in me."
"Well, it really did occur to me that you were a professional
burglar. Your last words which I overheard before intruding upon you
seem to bear out that supposition."
"What were they?"
"'Is there some secret drawer that I have overlooked?' Perhaps
you will do me the favor to explain them."
"I can't. They were spoken unconsciously, I assure you. This
habit of walking in my sleep has got me into trouble several times
before."
"Then take my advice and discontinue it."
"I will. I should have asked you to lock me in my chamber if I
could have foreseen what has happened."
"Mr. Kirby," said Dr. Thorp sternly, "you must think I am a
simpleton to be taken in by such a transparent falsehood. I was
deceived in you, I admit, but now I understand your real character. I
won't have you arrested, though I ought, but I require you to leave
my house at once."
"In the middle of the night?" said Kirby in dismay.
"Yes. I cannot agree to shelter you even for the balance of the
night."
"Tell me one thing," said Kirby, changing his tone; "did any one
put you on your guard against me?"
"Yes."
"It was Dean Dunham."
"You can form your own conclusions."
"That is all you need tell me. I understand it all. I will go to my
room and secure my luggage, and then bid you good-bye."
"I will wait for you."
"I owe you another debt, Dean Dunham!" said Kirby, as he left
the house with the pleasant prospect of a sleepless night.
CHAPTER XXVII.
THE LONELY CABIN.
Dean had left the breakfast-table the next morning, and was
considering what would be the next stage of his journey when Dr.
Thorp was announced.
"Mr. Dunham," he said, "I have come to thank you for your
warning of last evening."
"I hope it was of service to you, sir."
"It was of essential service. Your old acquaintance had planned
to rob me of a sum of money and a quantity of government bonds,
but being on my guard I was able to frustrate his designs."
"How did it happen?" asked Mr. Gunnison, his curiosity excited.
"In the middle of the night, or rather a little after midnight, I
heard some one going downstairs softly. I followed unobserved, and
caught my guest opening the drawers in my cabinet."
"Where is he now?"
"I ordered him out of the house. He stood not upon the order of
his going, but went at once. Where he is now I cannot inform you,
but presume he has placed several miles between himself and
Carterville. Fortunately he went empty-handed, and my money and
bonds are still in my possession. But for our young friend here I
should hardly be able to say that."
"You are indebted to me for bringing him to Carterville, Dr.
Thorp," said Mr. Gunnison in a jocular tone. "How much are you
going to allow me?"
"You are amply repaid by his services," said the doctor, "judging
from the comments I have heard upon his performance. I am under
obligations to him, however, which I ought to acknowledge. Mr.
Dunham," he continued, taking from his pocket a small gold watch
and chain, "I see you have no watch. Please accept this with my
best wishes."
It was an Elgin gold watch of neat pattern which he offered to
Dean.
"It is not quite new," proceeded the doctor. "I bought it of a
young man in need of money, and having paid him its full value I
have no scruple in giving it away."
"Thank you very much," said Dean, his face showing the
satisfaction he felt. "I have felt the need of a watch ever since I
began to travel, but never dreamed of anything better than a silver
one. I shall be very proud of this one."
"And I am very glad to give it to you. In what direction do you
propose to journey!"
"Westward, sir. I haven't any very clear ideas further than that."
"Shall you go as far as Colorado?"
"Yes, sir; I think so."
"I have a nephew out there somewhere—Henry Thorp—a young
man of twenty-five. He is probably mining, but I don't know his
location. Should you run across him, ask him to communicate with
me. His aunt and myself will be glad to hear from him."
"I will not forget it, sir," said Dean, though he thought it quite
improbable that he and the nephew referred to would ever meet.
Dr. Thorp took his leave, and Dean soon after took leave of the
Gunnison family. He was pressed to remain and play another game
of baseball, but felt that he could not spare the time.
A week later found Dean only a hundred miles farther on his
way. He might have accomplished this distance on the cars in a few
hours, but he preferred to make a leisurely trip, looking out for a
chance to earn money on the way. But after a season of prosperity a
dull time had come to him. During the week he did not make a
single dollar. He encountered several fair-sized towns, but did not
feel able to give an entire entertainment himself. His stock of money
dwindled, and he began to feel anxious.
Towards nightfall he found himself apparently at a distance from
any town, and began to feel some solicitude as to where he could
pass the night. It was a mountain region, and the day seemed to be
shorter than on the plains. The air was chilly, and Dean felt that it
would be dangerous to spend the night out of doors.
In this emergency he was pleased to descry a rough cabin a
hundred feet from the road.
"There is shelter at any rate if they will take me In," thought
Dean. "I will take care not to wander into such a wild region again."
He went up to the door, and knocked with his bare knuckles.
He heard a shuffling noise inside, and an old woman, with gray
hair, unconfined and hanging loose like a horse's mane, faced him.
"Who are you?" she inquired abruptly.
"A traveler," answered Dean.
"What do you want?"
"I have lost my way. Can you let me stay here all night?"
"This isn't a tavern," she responded in a surly tone.
"I suppose not, but I am willing to pay for supper and a lodging.
I don't see any other house near by, or I would not trouble you."
The old woman eyed him with a curious scrutiny which made
him vaguely uncomfortable, so weird and uncanny was her look.
"Have you got any money?" she asked at last.
"A little," answered Dean, growing suddenly cautious.
"Well, you can come in," she said after a pause.
Dean entered, and cast a glance about him.
The cabin was certainly a primitive one. What furniture it
contained seemed home made, put together awkwardly with such
material as came to hand. In place of chairs were two boxes such as
are used to contain shoes, placed bottom up. There was a small
stove, the heat of which seemed grateful to the chilly young traveler.
"It is cold," remarked Dean, by way of opening the conversation.
"Humph!" answered the woman. "Have you come all the way to
tell me that?"
"Evidently the old woman isn't sociable," thought Dean.
"Where do you live when you're to home?" asked the woman
after a pause.
"In New York State."
"What did you come out here for?"
"I had my living to make," answered Dean, feeling
uncomfortable.
"I haven't found any, and I've lived here goin' on ten years. I
suppose you want some supper," she continued ungraciously.
"Yes, I am very hungry. I am sorry to put you to any trouble."
The woman did not answer, but going to a rude pantry took out
a plate of meat, and some dry bread. The former she put in the
oven, and proceeded to brew some tea.
Dean watched her preparations with eager interest. It seemed to
him that he had never been so hungry. He had probably walked ten
miles over a rough path, and the exercise had tired him as much as
twice the distance on the plain. Besides he had his valise with him,
and had found it decidedly an incumbrance.
From time to time the old woman paused in her preparations
and eyed him searchingly. What it was that attracted her attention
Dean could not guess till she suddenly pointed to his chain, and
asked, "Is there a watch at the end of that?"
"Yes," answered Dean with a sudden feeling of apprehension.
"Let me look at it."
Reluctantly he drew out the watch, and into the woman's eyes
crept a covetous gleam, as she advanced and took it in her hand.
"It's pretty," she said. "What's it worth?"
"I don't know," answered Dean. "I didn't buy it. It was a present
to me."
"It ought to be worth a good sum."
"I value it because it was given me by a friend," said Dean
hurriedly.
"We've got nothing to tell time by," said the woman, slowly, still
eying the watch with a fixed look, "except the sun."
Dean did not reply.
"How do you wind it up?" asked the woman after a pause. "Do
you have a key?"
"No; it's a stem-winder."
"What's that?"
"I will show you," and Dean wound the watch as far as it would
go.
"I never saw the like of that," said his hostess with a look of
mingled curiosity and surprise.
She released her hold upon the watch, and Dean put it back in
his pocket, rather relieved to have recovered possession of it again.
Five minutes later the meal was ready, such as it was.
"Set up," said the woman.
Dean obeyed with alacrity.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookmasss.com