0% found this document useful (0 votes)
5 views

Python data science cookbook over 60 practical recipes to help you explore Python and its robust data science capabilities Subramanian pdf download

The document promotes the 'Python Data Science Cookbook' by Subramanian, which offers over 60 practical recipes for exploring Python's data science capabilities. It includes links to download the book and other recommended resources related to data science and Python programming. The document also provides a detailed table of contents outlining various topics covered in the cookbook.

Uploaded by

berazoarato
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Python data science cookbook over 60 practical recipes to help you explore Python and its robust data science capabilities Subramanian pdf download

The document promotes the 'Python Data Science Cookbook' by Subramanian, which offers over 60 practical recipes for exploring Python's data science capabilities. It includes links to download the book and other recommended resources related to data science and Python programming. The document also provides a detailed table of contents outlining various topics covered in the cookbook.

Uploaded by

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

Download the full version and explore a variety of ebooks

or textbooks at https://ebookultra.com

Python data science cookbook over 60 practical


recipes to help you explore Python and its robust
data science capabilities Subramanian

_____ Follow the link below to get your download now _____

https://ebookultra.com/download/python-data-science-
cookbook-over-60-practical-recipes-to-help-you-explore-
python-and-its-robust-data-science-capabilities-subramanian/

Access ebookultra.com now to download high-quality


ebooks or textbooks
Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Data Driven SEO with Python Solve SEO Challenges with Data
Science Using Python 4th Edition Andreas Voniatis

https://ebookultra.com/download/data-driven-seo-with-python-solve-seo-
challenges-with-data-science-using-python-4th-edition-andreas-
voniatis/

Data Science Fundamentals with R Python and Open Data 1st


Edition Marco Cremonini

https://ebookultra.com/download/data-science-fundamentals-with-r-
python-and-open-data-1st-edition-marco-cremonini/

Geographic Data Science with Python 1st Edition Sergio Rey

https://ebookultra.com/download/geographic-data-science-with-
python-1st-edition-sergio-rey/

Python Data Visualization Cookbook 2nd Edition Igor


Milovanovic

https://ebookultra.com/download/python-data-visualization-
cookbook-2nd-edition-igor-milovanovic/
Statistics Data Mining and Machine Learning in Astronomy A
Practical Python Guide for the Analysis of Survey Data
Željko Ivezi■
https://ebookultra.com/download/statistics-data-mining-and-machine-
learning-in-astronomy-a-practical-python-guide-for-the-analysis-of-
survey-data-zeljko-ivezic/

Python Programming An Introduction to Computer Science


John M. Zelle

https://ebookultra.com/download/python-programming-an-introduction-to-
computer-science-john-m-zelle/

Practical Data Science with R 1st Edition Nina Zumel

https://ebookultra.com/download/practical-data-science-with-r-1st-
edition-nina-zumel/

Python cookbook Third Edition Beazley

https://ebookultra.com/download/python-cookbook-third-edition-beazley/

Data Structures and Algorithms Using Python 1st Edition


Rance D. Necaise

https://ebookultra.com/download/data-structures-and-algorithms-using-
python-1st-edition-rance-d-necaise/
Python data science cookbook over 60 practical recipes to
help you explore Python and its robust data science
capabilities Subramanian Digital Instant Download
Author(s): Subramanian, Gopi
ISBN(s): 9781784396404, 1784396400
Edition: Online-Ausg.
File Details: PDF, 7.27 MB
Year: 2015
Language: english
Python Data Science Cookbook
Table of Contents
Python Data Science Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There’s more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Python for Data Science
Introduction
Using dictionary objects
Getting ready
How to do it…
How it works…
There’s more…
See also
Working with a dictionary of dictionaries
Getting ready
How to do it…
How it works…
See also
Working with tuples
Getting ready
How to do it…
How it works…
There’s more…
See also
Using sets
Getting ready
How to do it…
How it works…
There’s more…
Writing a list
Getting ready
How to do it…
How it works…
There’s more…
Creating a list from another list - list comprehension
Getting ready
How to do it…
How it works…
There’s more…
Using iterators
Getting ready
How to do it…
How it works…
There’s more…
Generating an iterator and a generator
Getting ready
How it do it…
How it works…
There’s more…
Using iterables
Getting ready
How to do it…
How it works..
See also
Passing a function as a variable
Getting ready
How to do it…
How it works…
Embedding functions in another function
Getting ready
How to do it…
How it works…
Passing a function as a parameter
Getting ready
How to do it…
How it works…
Returning a function
Getting ready
How to do it…
How it works…
There’s more…
Altering the function behavior with decorators
Getting ready
How to do it…
How it works…
Creating anonymous functions with lambda
Getting ready
How to do it…
How it works…
Using the map function
Getting ready
How to do it…
How it works…
There’s more…
Working with filters
Getting ready
How to do it…
How it works…
Using zip and izip
Getting ready
How to do it…
How it works…
There’s more…
See also
Processing arrays from the tabular data
Getting ready
How to do it…
How it works…
There’s more…
Preprocessing the columns
Getting ready
How to do it…
How it works…
There’s more…
Sorting lists
Getting ready
How to do it…
How it works…
There’s more…
Sorting with a key
Getting ready
How to do it…
How it works…
There’s more…
Working with itertools
Getting ready
How to do it…
How it works…
2. Python Environments
Introduction
Using NumPy libraries
Getting ready
How to do it…
How it works…
There’s more…
See also
Plotting with matplotlib
Getting ready
How to do it…
How it works…
There’s more…
Machine learning with scikit-learn
Getting ready
How to do it…
How it works…
There’s more…
See also
3. Data Analysis – Explore and Wrangle
Introduction
Analyzing univariate data graphically
Getting ready
How to do it…
How it works…
See also
Grouping the data and using dot plots
Getting ready
How to do it…
How it works…
See also
Using scatter plots for multivariate data
Getting ready
How to do it…
How it works…
See also
Using heat maps
Getting ready
How to do it…
How it works…
There’s more…
See also
Performing summary statistics and plots
Getting ready
How to do it…
How it works…
See also
Using a box-and-whisker plot
Getting ready
How to do it…
How it works…
There’s more…
Imputing the data
Getting ready
How to do it…
How it works…
There’s more…
See also
Performing random sampling
Getting ready
How to do it…
How it works…
There’s more…
Stratified sampling
Progressive sampling
Scaling the data
Getting ready
How to do it…
How it works…
There’s more…
Standardizing the data
Getting ready
How to do it…
How it works…
There’s more…
Performing tokenization
Getting ready
How to do it…
How it works…
There’s more…
See also
Removing stop words
How to do it…
How it works…
There’s more…
See also
Stemming the words
Getting ready
How to do it…
How it works…
There’s more…
See also
Performing word lemmatization
Getting ready
How to do it…
How it works…
There’s more…
See also
Representing the text as a bag of words
Getting ready
How to do it…
How it works…
There’s more…
See also
Calculating term frequencies and inverse document frequencies
Getting ready
How to do it…
How it works…
There’s more…
4. Data Analysis – Deep Dive
Introduction
Matrix Decomposition:
Extracting the principal components
Getting ready
How to do it…
How it works…
There’s more…
See also
Using Kernel PCA
Getting ready
How to do it…
How it works…
There’s more…
Extracting features using singular value decomposition
Getting ready
How to do it…
How it works…
There’s more…
Reducing the data dimension with random projection
Getting ready
How to do it…
How it works…
There’s more…
See also
Decomposing the feature matrices using non-negative matrix factorization
Getting ready
How to do it…
How it works…
There’s more…
See also
5. Data Mining – Needle in a Haystack
Introduction
Working with distance measures
Getting ready
How to do it…
How it works…
There’s more…
See also
Learning and using kernel methods
Getting ready
How to do it…
How it works…
There’s more…
See also
Clustering data using the k-means method
Getting ready
How to do it…
How it works…
There’s more…
See also
Learning vector quantization
Getting ready
How to do it…
How it works…
There’s more…
See also
Finding outliers in univariate data
Getting ready
How to do it…
How it works…
There’s more…
See also
Discovering outliers using the local outlier factor method
Getting ready
How to do it…
How it works…
There’s more…
6. Machine Learning 1
Introduction
Preparing data for model building
Getting ready
How to do it…
How it works…
There’s more…
Finding the nearest neighbors
Getting ready
How to do it…
How it works…
There’s more…
See also
Classifying documents using Naïve Bayes
Getting ready
How to do it…
How it works…
There’s more…
See also
Building decision trees to solve multiclass problems
Getting ready
How to do it…
How it works…
There’s more…
See also
7. Machine Learning 2
Introduction
Predicting real-valued numbers using regression
Getting ready
How to do it…
How it works…
There’s more…
See also
Learning regression with L2 shrinkage – ridge
Getting ready
How to do it…
How it works…
There’s more…
See also
Learning regression with L1 shrinkage – LASSO
Getting ready
How to do it…
How it works…
There’s more…
See also
Using cross-validation iterators with L1 and L2 shrinkage
Getting ready
How to do it…
How it works…
There’s more…
See also
8. Ensemble Methods
Introduction
Understanding Ensemble – Bagging Method
Exploring the Variety of Random
Documents with Different Content
“Because . . . because . . . you and I are not wanted. . . . We have
nowhere to sleep even.”
“Father, and why is it Olga Kirillovna has freckles on her face?”
“Oh, shut up! I am tired of you.”
After a moment’s thought, Zaikin dressed and went out into the
street for a breath of air. . . . He looked at the grey morning sky, at
the motionless clouds, heard the lazy call of the drowsy corncrake,
and began dreaming of the next day, when he would go to town,
and coming back from the court would tumble into bed. . . .
Suddenly the figure of a man appeared round the corner.
“A watchman, no doubt,” thought Zaikin. But going nearer and
looking more closely he recognized in the figure the summer visitor
in the ginger trousers.
“You’re not asleep?” he asked.
“No, I can’t sleep,” sighed Ginger Trousers. “I am enjoying Nature
. . . . A welcome visitor, my wife’s mother, arrived by the night train,
you know. She brought with her our nieces . . . splendid girls! I was
delighted to see them, although . . . it’s very damp! And you, too,
are enjoying Nature?”
“Yes,” grunted Zaikin, “I am enjoying it, too. . . . Do you know
whether there is any sort of tavern or restaurant in the
neighbourhood?”
Ginger Trousers raised his eyes to heaven and meditated
profoundly.
TYPHUS

A
YOUNG lieutenant called Klimov was travelling from
Petersburg to Moscow in a smoking carriage of the mail train.
Opposite him was sitting an elderly man with a shaven face
like a sea captain’s, by all appearances a well-to-do Finn or Swede.
He pulled at his pipe the whole journey and kept talking about the
same subject:
“Ha, you are an officer! I have a brother an officer too, only he is
a naval officer. . . . He is a naval officer, and he is stationed at
Kronstadt. Why are you going to Moscow?”
“I am serving there.”
“Ha! And are you a family man?”
“No, I live with my sister and aunt.”
“My brother’s an officer, only he is a naval officer; he has a wife
and three children. Ha!”
The Finn seemed continually surprised at something, and gave a
broad idiotic grin when he exclaimed “Ha!” and continually puffed at
his stinking pipe. Klimov, who for some reason did not feel well, and
found it burdensome to answer questions, hated him with all his
heart. He dreamed of how nice it would be to snatch the wheezing
pipe out of his hand and fling it under the seat, and drive the Finn
himself into another compartment.
“Detestable people these Finns and . . . Greeks,” he thought.
“Absolutely superfluous, useless, detestable people. They simply fill
up space on the earthly globe. What are they for?”
And the thought of Finns and Greeks produced a feeling akin to
sickness all over his body. For the sake of comparison he tried to
think of the French, of the Italians, but his efforts to think of these
people evoked in his mind, for some reason, nothing but images of
organ-grinders, naked women, and the foreign oleographs which
hung over the chest of drawers at home, at his aunt’s.
Altogether the officer felt in an abnormal state. He could not
arrange his arms and legs comfortably on the seat, though he had
the whole seat to himself. His mouth felt dry and sticky; there was a
heavy fog in his brain; his thoughts seemed to be straying, not only
within his head, but outside his skull, among the seats and the
people that were shrouded in the darkness of night. Through the
mist in his brain, as through a dream, he heard the murmur of
voices, the rumble of wheels, the slamming of doors. The sounds of
the bells, the whistles, the guards, the running to and fro of
passengers on the platforms, seemed more frequent than usual. The
time flew by rapidly, imperceptibly, and so it seemed as though the
train were stopping at stations every minute, and metallic voices
crying continually:
“Is the mail ready?”
“Yes!” was repeatedly coming from outside.
It seemed as though the man in charge of the heating came in too
often to look at the thermometer, that the noise of trains going in
the opposite direction and the rumble of the wheels over the bridges
was incessant. The noise, the whistles, the Finn, the tobacco smoke
—all this mingling with the menace and flickering of the misty
images in his brain, the shape and character of which a man in
health can never recall, weighed upon Klimov like an unbearable
nightmare. In horrible misery he lifted his heavy head, looked at the
lamp in the rays of which shadows and misty blurs seemed to be
dancing. He wanted to ask for water, but his parched tongue would
hardly move, and he scarcely had strength to answer the Finn’s
questions. He tried to lie down more comfortably and go to sleep,
but he could not succeed. The Finn several times fell asleep, woke
up again, lighted his pipe, addressed him with his “Ha!” and went to
sleep again; and still the lieutenant’s legs could not get into a
comfortable position, and still the menacing images stood facing
him.
At Spirovo he went out into the station for a drink of water. He
saw people sitting at the table and hurriedly eating.
“And how can they eat!” he thought, trying not to sniff the air, that
smelt of roast meat, and not to look at the munching mouths —they
both seemed to him sickeningly disgusting.
A good-looking lady was conversing loudly with a military man in a
red cap, and showing magnificent white teeth as she smiled; and the
smile, and the teeth, and the lady herself made on Klimov the same
revolting impression as the ham and the rissoles. He could not
understand how it was the military man in the red cap was not ill at
ease, sitting beside her and looking at her healthy, smiling face.
When after drinking some water he went back to his carriage, the
Finn was sitting smoking; his pipe was wheezing and squelching like
a golosh with holes in it in wet weather.
“Ha!” he said, surprised; “what station is this?”
“I don’t know,” answered Klimov, lying down and shutting his
mouth that he might not breathe the acrid tobacco smoke.
“And when shall we reach Tver?”
“I don’t know. Excuse me, I . . . I can’t answer. I am ill. I caught
cold today.”
The Finn knocked his pipe against the window-frame and began
talking of his brother, the naval officer. Klimov no longer heard him;
he was thinking miserably of his soft, comfortable bed, of a bottle of
cold water, of his sister Katya, who was so good at making one
comfortable, soothing, giving one water. He even smiled when the
vision of his orderly Pavel, taking off his heavy stifling boots and
putting water on the little table, flitted through his imagination. He
fancied that if he could only get into his bed, have a drink of water,
his nightmare would give place to sound healthy sleep.
“Is the mail ready?” a hollow voice reached him from the distance.
“Yes,” answered a bass voice almost at the window.
It was already the second or third station from Spirovo.
The time was flying rapidly in leaps and bounds, and it seemed as
though the bells, whistles, and stoppings would never end. In
despair Klimov buried his face in the corner of the seat, clutched his
head in his hands, and began again thinking of his sister Katya and
his orderly Pavel, but his sister and his orderly were mixed up with
the misty images in his brain, whirled round, and disappeared. His
burning breath, reflected from the back of the seat, seemed to scald
his face; his legs were uncomfortable; there was a draught from the
window on his back; but, however wretched he was, he did not want
to change his position. . . . A heavy nightmarish lethargy gradually
gained possession of him and fettered his limbs.
When he brought himself to raise his head, it was already light in
the carriage. The passengers were putting on their fur coats and
moving about. The train was stopping. Porters in white aprons and
with discs on their breasts were bustling among the passengers and
snatching up their boxes. Klimov put on his great-coat, mechanically
followed the other passengers out of the carriage, and it seemed to
him that not he, but some one else was moving, and he felt that his
fever, his thirst, and the menacing images which had not let him
sleep all night, came out of the carriage with him. Mechanically he
took his luggage and engaged a sledge-driver. The man asked him
for a rouble and a quarter to drive to Povarsky Street, but he did not
haggle, and without protest got submissively into the sledge. He still
understood the difference of numbers, but money had ceased to
have any value to him.
At home Klimov was met by his aunt and his sister Katya, a girl of
eighteen. When Katya greeted him she had a pencil and exercise
book in her hand, and he remembered that she was preparing for an
examination as a teacher. Gasping with fever, he walked aimlessly
through all the rooms without answering their questions or
greetings, and when he reached his bed he sank down on the pillow.
The Finn, the red cap, the lady with the white teeth, the smell of
roast meat, the flickering blurs, filled his consciousness, and by now
he did not know where he was and did not hear the agitated voices.
When he recovered consciousness he found himself in bed,
undressed, saw a bottle of water and Pavel, but it was no cooler, nor
softer, nor more comfortable for that. His arms and legs, as before,
refused to lie comfortably; his tongue stuck to the roof of his mouth,
and he heard the wheezing of the Finn’s pipe. . . . A stalwart, black-
bearded doctor was busy doing something beside the bed, brushing
against Pavel with his broad back.
“It’s all right, it’s all right, young man,” he muttered. “Excellent,
excellent . . . goo-od, goo-od . . . !”
The doctor called Klimov “young man,” said “goo-od” instead of
“good” and “so-o” instead of “so.”
“So-o . . . so-o . . . so-o,” he murmured. “Goo-od, goo-od . . . !
Excellent, young man. You mustn’t lose heart!”
The doctor’s rapid, careless talk, his well-fed countenance, and
condescending “young man,” irritated Klimov.
“Why do you call me ‘young man’?” he moaned. “What familiarity!
Damn it all!”
And he was frightened by his own voice. The voice was so dried
up, so weak and peevish, that he would not have known it.
“Excellent, excellent!” muttered the doctor, not in the least
offended. . . . “You mustn’t get angry, so-o, so-o, so-s. . . .”
And the time flew by at home with the same startling swiftness as
in the railway carriage. The daylight was continually being replaced
by the dusk of evening. The doctor seemed never to leave his
bedside, and he heard at every moment his “so-o, so-o, so-o.” A
continual succession of people was incessantly crossing the
bedroom. Among them were: Pavel, the Finn, Captain Yaroshevitch,
Lance-Corporal Maximenko, the red cap, the lady with the white
teeth, the doctor. They were all talking and waving their arms,
smoking and eating. Once by daylight Klimov saw the chaplain of the
regiment, Father Alexandr, who was standing before the bed,
wearing a stole and with a prayer-book in his hand. He was
muttering something with a grave face such as Klimov had never
seen in him before. The lieutenant remembered that Father Alexandr
used in a friendly way to call all the Catholic officers “Poles,” and
wanting to amuse him, he cried:
“Father, Yaroshevitch the Pole has climbed up a pole!”
But Father Alexandr, a light-hearted man who loved a joke, did not
smile, but became graver than ever, and made the sign of the cross
over Klimov. At night-time by turn two shadows came noiselessly in
and out; they were his aunt and sister. His sister’s shadow knelt
down and prayed; she bowed down to the ikon, and her grey
shadow on the wall bowed down too, so that two shadows were
praying. The whole time there was a smell of roast meat and the
Finn’s pipe, but once Klimov smelt the strong smell of incense. He
felt so sick he could not lie still, and began shouting:
“The incense! Take away the incense!”
There was no answer. He could only hear the subdued singing of
the priest somewhere and some one running upstairs.
When Klimov came to himself there was not a soul in his
bedroom. The morning sun was streaming in at the window through
the lower blind, and a quivering sunbeam, bright and keen as the
sword’s edge, was flashing on the glass bottle. He heard the rattle of
wheels— so there was no snow now in the street. The lieutenant
looked at the ray, at the familiar furniture, at the door, and the first
thing he did was to laugh. His chest and stomach heaved with
delicious, happy, tickling laughter. His whole body from head to foot
was overcome by a sensation of infinite happiness and joy in life,
such as the first man must have felt when he was created and first
saw the world. Klimov felt a passionate desire for movement,
people, talk. His body lay a motionless block; only his hands stirred,
but that he hardly noticed, and his whole attention was concentrated
on trifles. He rejoiced in his breathing, in his laughter, rejoiced in the
existence of the water-bottle, the ceiling, the sunshine, the tape on
the curtains. God’s world, even in the narrow space of his bedroom,
seemed beautiful, varied, grand. When the doctor made his
appearance, the lieutenant was thinking what a delicious thing
medicine was, how charming and pleasant the doctor was, and how
nice and interesting people were in general.
“So-o, so, so. . . Excellent, excellent! . . . Now we are well again. .
. . Goo-od, goo-od!” the doctor pattered.
The lieutenant listened and laughed joyously; he remembered the
Finn, the lady with the white teeth, the train, and he longed to
smoke, to eat.
“Doctor,” he said, “tell them to give me a crust of rye bread and
salt, and . . . and sardines.”
The doctor refused; Pavel did not obey the order, and did not go
for the bread. The lieutenant could not bear this and began crying
like a naughty child.
“Baby!” laughed the doctor. “Mammy, bye-bye!”
Klimov laughed, too, and when the doctor went away he fell into a
sound sleep. He woke up with the same joyfulness and sensation of
happiness. His aunt was sitting near the bed.
“Well, aunt,” he said joyfully. “What has been the matter?”
“Spotted typhus.”
“Really. But now I am well, quite well! Where is Katya?”
“She is not at home. I suppose she has gone somewhere from her
examination.”
The old lady said this and looked at her stocking; her lips began
quivering, she turned away, and suddenly broke into sobs. Forgetting
the doctor’s prohibition in her despair, she said:
“Ah, Katya, Katya! Our angel is gone! Is gone!”
She dropped her stocking and bent down to it, and as she did so
her cap fell off her head. Looking at her grey head and
understanding nothing, Klimov was frightened for Katya, and asked:
“Where is she, aunt?”
The old woman, who had forgotten Klimov and was thinking only
of her sorrow, said:
“She caught typhus from you, and is dead. She was buried the
day before yesterday.”
This terrible, unexpected news was fully grasped by Klimov’s
consciousness; but terrible and startling as it was, it could not
overcome the animal joy that filled the convalescent. He cried and
laughed, and soon began scolding because they would not let him
eat.
Only a week later when, leaning on Pavel, he went in his dressing-
gown to the window, looked at the overcast spring sky and listened
to the unpleasant clang of the old iron rails which were being carted
by, his heart ached, he burst into tears, and leaned his forehead
against the window-frame.
“How miserable I am!” he muttered. “My God, how miserable!”
And joy gave way to the boredom of everyday life and the feeling
of his irrevocable loss.
A MISFORTUNE

S
OFYA PETROVNA, the wife of Lubyantsev the notary, a
handsome young woman of five-and-twenty, was walking
slowly along a track that had been cleared in the wood, with
Ilyin, a lawyer who was spending the summer in the neighbourhood.
It was five o’clock in the evening. Feathery-white masses of cloud
stood overhead; patches of bright blue sky peeped out between
them. The clouds stood motionless, as though they had caught in
the tops of the tall old pine-trees. It was still and sultry.
Farther on, the track was crossed by a low railway embankment
on which a sentinel with a gun was for some reason pacing up and
down. Just beyond the embankment there was a large white church
with six domes and a rusty roof.
“I did not expect to meet you here,” said Sofya Petrovna, looking
at the ground and prodding at the last year’s leaves with the tip of
her parasol, “and now I am glad we have met. I want to speak to
you seriously and once for all. I beg you, Ivan Mihalovitch, if you
really love and respect me, please make an end of this pursuit of
me! You follow me about like a shadow, you are continually looking
at me not in a nice way, making love to me, writing me strange
letters, and . . . and I don’t know where it’s all going to end! Why,
what can come of it?”
Ilyin said nothing. Sofya Petrovna walked on a few steps and
continued:
“And this complete transformation in you all came about in the
course of two or three weeks, after five years’ friendship. I don’t
know you, Ivan Mihalovitch!”
Sofya Petrovna stole a glance at her companion. Screwing up his
eyes, he was looking intently at the fluffy clouds. His face looked
angry, ill-humoured, and preoccupied, like that of a man in pain
forced to listen to nonsense.
“I wonder you don’t see it yourself,” Madame Lubyantsev went on,
shrugging her shoulders. “You ought to realize that it’s not a very
nice part you are playing. I am married; I love and respect my
husband. . . . I have a daughter . . . . Can you think all that means
nothing? Besides, as an old friend you know my attitude to family
life and my views as to the sanctity of marriage.”
Ilyin cleared his throat angrily and heaved a sigh.
“Sanctity of marriage . . .” he muttered. “Oh, Lord!”
“Yes, yes. . . . I love my husband, I respect him; and in any case I
value the peace of my home. I would rather let myself be killed than
be a cause of unhappiness to Andrey and his daughter. . . . And I
beg you, Ivan Mihalovitch, for God’s sake, leave me in peace! Let us
be as good, true friends as we used to be, and give up these sighs
and groans, which really don’t suit you. It’s settled and over! Not a
word more about it. Let us talk of something else.”
Sofya Petrovna again stole a glance at Ilyin’s face. Ilyin was
looking up; he was pale, and was angrily biting his quivering lips.
She could not understand why he was angry and why he was
indignant, but his pallor touched her.
“Don’t be angry; let us be friends,” she said affectionately.
“Agreed? Here’s my hand.”
Ilyin took her plump little hand in both of his, squeezed it, and
slowly raised it to his lips.
“I am not a schoolboy,” he muttered. “I am not in the least
tempted by friendship with the woman I love.”
“Enough, enough! It’s settled and done with. We have reached the
seat; let us sit down.”
Sofya Petrovna’s soul was filled with a sweet sense of relief: the
most difficult and delicate thing had been said, the painful question
was settled and done with. Now she could breathe freely and look
Ilyin straight in the face. She looked at him, and the egoistic feeling
of the superiority of the woman over the man who loves her,
agreeably flattered her. It pleased her to see this huge, strong man,
with his manly, angry face and his big black beard—clever,
cultivated, and, people said, talented—sit down obediently beside
her and bow his head dejectedly. For two or three minutes they sat
without speaking.
“Nothing is settled or done with,” began Ilyin. “You repeat copy-
book maxims to me. ‘I love and respect my husband . . . the sanctity
of marriage. . . .’ I know all that without your help, and I could tell
you more, too. I tell you truthfully and honestly that I consider the
way I am behaving as criminal and immoral. What more can one say
than that? But what’s the good of saying what everybody knows?
Instead of feeding nightingales with paltry words, you had much
better tell me what I am to do.”
“I’ve told you already—go away.”
“As you know perfectly well, I have gone away five times, and
every time I turned back on the way. I can show you my through
tickets —I’ve kept them all. I have not will enough to run away from
you! I am struggling. I am struggling horribly; but what the devil am
I good for if I have no backbone, if I am weak, cowardly! I can’t
struggle with Nature! Do you understand? I cannot! I run away from
here, and she holds on to me and pulls me back. Contemptible,
loathsome weakness!”
Ilyin flushed crimson, got up, and walked up and down by the
seat.
“I feel as cross as a dog,” he muttered, clenching his fists. “I hate
and despise myself! My God! like some depraved schoolboy, I am
making love to another man’s wife, writing idiotic letters, degrading
myself . . . ugh!”
Ilyin clutched at his head, grunted, and sat down. “And then your
insincerity!” he went on bitterly. “If you do dislike my disgusting
behaviour, why have you come here? What drew you here? In my
letters I only ask you for a direct, definite answer—yes or no; but
instead of a direct answer, you contrive every day these ‘chance’
meetings with me and regale me with copy-book maxims!”
Madame Lubyantsev was frightened and flushed. She suddenly felt
the awkwardness which a decent woman feels when she is
accidentally discovered undressed.
“You seem to suspect I am playing with you,” she muttered. “I
have always given you a direct answer, and . . . only today I’ve
begged you . . .”
“Ough! as though one begged in such cases! If you were to say
straight out ‘Get away,’ I should have been gone long ago; but
you’ve never said that. You’ve never once given me a direct answer.
Strange indecision! Yes, indeed; either you are playing with me, or
else . . .”
Ilyin leaned his head on his fists without finishing. Sofya Petrovna
began going over in her own mind the way she had behaved from
beginning to end. She remembered that not only in her actions, but
even in her secret thoughts, she had always been opposed to Ilyin’s
love-making; but yet she felt there was a grain of truth in the
lawyer’s words. But not knowing exactly what the truth was, she
could not find answers to make to Ilyin’s complaint, however hard
she thought. It was awkward to be silent, and, shrugging her
shoulders, she said:
So I am to blame, it appears.”
“I don’t blame you for your insincerity,” sighed Ilyin. “I did not
mean that when I spoke of it. . . . Your insincerity is natural and in
the order of things. If people agreed together and suddenly became
sincere, everything would go to the devil.”
Sofya Petrovna was in no mood for philosophical reflections, but
she was glad of a chance to change the conversation, and asked:
“But why?”
“Because only savage women and animals are sincere. Once
civilization has introduced a demand for such comforts as, for
instance, feminine virtue, sincerity is out of place. . . .”
Ilyin jabbed his stick angrily into the sand. Madame Lubyantsev
listened to him and liked his conversation, though a great deal of it
she did not understand. What gratified her most was that she, an
ordinary woman, was talked to by a talented man on “intellectual”
subjects; it afforded her great pleasure, too, to watch the working of
his mobile, young face, which was still pale and angry. She failed to
understand a great deal that he said, but what was clear to her in
his words was the attractive boldness with which the modern man
without hesitation or doubt decides great questions and draws
conclusive deductions.
She suddenly realized that she was admiring him, and was
alarmed.
“Forgive me, but I don’t understand,” she said hurriedly. “What
makes you talk of insincerity? I repeat my request again: be my
good, true friend; let me alone! I beg you most earnestly!”
“Very good; I’ll try again,” sighed Ilyin. “Glad to do my best. . . .
Only I doubt whether anything will come of my efforts. Either I shall
put a bullet through my brains or take to drink in an idiotic way. I
shall come to a bad end! There’s a limit to everything— to struggles
with Nature, too. Tell me, how can one struggle against madness? If
you drink wine, how are you to struggle against intoxication? What
am I to do if your image has grown into my soul, and day and night
stands persistently before my eyes, like that pine there at this
moment? Come, tell me, what hard and difficult thing can I do to get
free from this abominable, miserable condition, in which all my
thoughts, desires, and dreams are no longer my own, but belong to
some demon who has taken possession of me? I love you, love you
so much that I am completely thrown out of gear; I’ve given up my
work and all who are dear to me; I’ve forgotten my God! I’ve never
been in love like this in my life.”
Sofya Petrovna, who had not expected such a turn to their
conversation, drew away from Ilyin and looked into his face in
dismay. Tears came into his eyes, his lips were quivering, and there
was an imploring, hungry expression in his face.
“I love you!” he muttered, bringing his eyes near her big,
frightened eyes. “You are so beautiful! I am in agony now, but I
swear I would sit here all my life, suffering and looking in your eyes.
But . . . be silent, I implore you!”
Sofya Petrovna, feeling utterly disconcerted, tried to think as
quickly as possible of something to say to stop him. “I’ll go away,”
she decided, but before she had time to make a movement to get
up, Ilyin was on his knees before her. . . . He was clasping her
knees, gazing into her face and speaking passionately, hotly,
eloquently. In her terror and confusion she did not hear his words;
for some reason now, at this dangerous moment, while her knees
were being agreeably squeezed and felt as though they were in a
warm bath, she was trying, with a sort of angry spite, to interpret
her own sensations. She was angry that instead of brimming over
with protesting virtue, she was entirely overwhelmed with weakness,
apathy, and emptiness, like a drunken man utterly reckless; only at
the bottom of her soul a remote bit of herself was malignantly
taunting her: “Why don’t you go? Is this as it should be? Yes?”
Seeking for some explanation, she could not understand how it
was she did not pull away the hand to which Ilyin was clinging like a
leech, and why, like Ilyin, she hastily glanced to right and to left to
see whether any one was looking. The clouds and the pines stood
motionless, looking at them severely, like old ushers seeing mischief,
but bribed not to tell the school authorities. The sentry stood like a
post on the embankment and seemed to be looking at the seat.
“Let him look,” thought Sofya Petrovna.
“But . . . but listen,” she said at last, with despair in her voice.
“What can come of this? What will be the end of this?”
“I don’t know, I don’t know,” he whispered, waving off the
disagreeable questions.
They heard the hoarse, discordant whistle of the train. This cold,
irrelevant sound from the everyday world of prose made Sofya
Petrovna rouse herself.
“I can’t stay . . . it’s time I was at home,” she said, getting up
quickly. “The train is coming in. . . Andrey is coming by it! He will
want his dinner.”
Sofya Petrovna turned towards the embankment with a burning
face. The engine slowly crawled by, then came the carriages. It was
not the local train, as she had supposed, but a goods train. The
trucks filed by against the background of the white church in a long
string like the days of a man’s life, and it seemed as though it would
never end.
But at last the train passed, and the last carriage with the guard
and a light in it had disappeared behind the trees. Sofya Petrovna
turned round sharply, and without looking at Ilyin, walked rapidly
back along the track. She had regained her self-possession. Crimson
with shame, humiliated not by Ilyin—no, but by her own cowardice,
by the shamelessness with which she, a chaste and high-principled
woman, had allowed a man, not her husband, to hug her knees—
she had only one thought now: to get home as quickly as possible to
her villa, to her family. The lawyer could hardly keep pace with her.
Turning from the clearing into a narrow path, she turned round and
glanced at him so quickly that she saw nothing but the sand on his
knees, and waved to him to drop behind.
Reaching home, Sofya Petrovna stood in the middle of her room
for five minutes without moving, and looked first at the window and
then at her writing-table.
“You low creature!” she said, upbraiding herself. “You low
creature!”
To spite herself, she recalled in precise detail, keeping nothing
back—she recalled that though all this time she had been opposed to
Ilyin’s lovemaking, something had impelled her to seek an interview
with him; and what was more, when he was at her feet she had
enjoyed it enormously. She recalled it all without sparing herself, and
now, breathless with shame, she would have liked to slap herself in
the face.
“Poor Andrey!” she said to herself, trying as she thought of her
husband to put into her face as tender an expression as she could.
“Varya, my poor little girl, doesn’t know what a mother she has!
Forgive me, my dear ones! I love you so much . . . so much!”
And anxious to prove to herself that she was still a good wife and
mother, and that corruption had not yet touched that “sanctity of
marriage” of which she had spoken to Ilyin, Sofya Petrovna ran to
the kitchen and abused the cook for not having yet laid the table for
Andrey Ilyitch. She tried to picture her husband’s hungry and
exhausted appearance, commiserated him aloud, and laid the table
for him with her own hands, which she had never done before. Then
she found her daughter Varya, picked her up in her arms and
hugged her warmly; the child seemed to her cold and heavy, but she
was unwilling to acknowledge this to herself, and she began
explaining to the child how good, kind, and honourable her papa
was.
But when Andrey Ilyitch arrived soon afterwards she hardly
greeted him. The rush of false feeling had already passed off without
proving anything to her, only irritating and exasperating her by its
falsity. She was sitting by the window, feeling miserable and cross. It
is only by being in trouble that people can understand how far from
easy it is to be the master of one’s feelings and thoughts. Sofya
Petrovna said afterwards that there was a tangle within her which it
was as difficult to unravel as to count a flock of sparrows rapidly
flying by. From the fact that she was not overjoyed to see her
husband, that she did not like his manner at dinner, she concluded
all of a sudden that she was beginning to hate her husband.
Andrey Ilyitch, languid with hunger and exhaustion, fell upon the
sausage while waiting for the soup to be brought in, and ate it
greedily, munching noisily and moving his temples.
“My goodness!” thought Sofya Petrovna. “I love and respect him,
but . . . why does he munch so repulsively?”
The disorder in her thoughts was no less than the disorder in her
feelings. Like all persons inexperienced in combating unpleasant
ideas, Madame Lubyantsev did her utmost not to think of her
trouble, and the harder she tried the more vividly Ilyin, the sand on
his knees, the fluffy clouds, the train, stood out in her imagination.
“And why did I go there this afternoon like a fool?” she thought,
tormenting herself. “And am I really so weak that I cannot depend
upon myself?”
Fear magnifies danger. By the time Andrey Ilyitch was finishing the
last course, she had firmly made up her mind to tell her husband
everything and to flee from danger!
“I’ve something serious to say to you, Andrey,” she began after
dinner while her husband was taking off his coat and boots to lie
down for a nap.
“Well?”
“Let us leave this place!”
“H’m! . . . Where shall we go? It’s too soon to go back to town.”
“No; for a tour or something of that sort.
“For a tour . . .” repeated the notary, stretching. “I dream of that
myself, but where are we to get the money, and to whom am I to
leave the office?”
And thinking a little he added:
“Of course, you must be bored. Go by yourself if you like.”
Sofya Petrovna agreed, but at once reflected that Ilyin would be
delighted with the opportunity, and would go with her in the same
train, in the same compartment. . . . She thought and looked at her
husband, now satisfied but still languid. For some reason her eyes
rested on his feet—miniature, almost feminine feet, clad in striped
socks; there was a thread standing out at the tip of each sock.
Behind the blind a bumble-bee was beating itself against the
window-pane and buzzing. Sofya Petrovna looked at the threads on
the socks, listened to the bee, and pictured how she would set off . .
. . vis-à-vis Ilyin would sit, day and night, never taking his eyes off
her, wrathful at his own weakness and pale with spiritual agony. He
would call himself an immoral schoolboy, would abuse her, tear his
hair, but when darkness came on and the passengers were asleep or
got out at a station, he would seize the opportunity to kneel before
her and embrace her knees as he had at the seat in the wood. . . .
She caught herself indulging in this day-dream.
“Listen. I won’t go alone,” she said. “You must come with me.”
“Nonsense, Sofotchka!” sighed Lubyantsev. “One must be sensible
and not want the impossible.”
“You will come when you know all about it,” thought Sofya
Petrovna.
Making up her mind to go at all costs, she felt that she was out of
danger. Little by little her ideas grew clearer; her spirits rose and she
allowed herself to think about it all, feeling that however much she
thought, however much she dreamed, she would go away. While her
husband was asleep, the evening gradually came on. She sat in the
drawing-room and played the piano. The greater liveliness out of
doors, the sound of music, but above all the thought that she was a
sensible person, that she had surmounted her difficulties, completely
restored her spirits. Other women, her appeased conscience told her,
would probably have been carried off their feet in her position, and
would have lost their balance, while she had almost died of shame,
had been miserable, and was now running out of the danger which
perhaps did not exist! She was so touched by her own virtue and
determination that she even looked at herself two or three times in
the looking-glass.
When it got dark, visitors arrived. The men sat down in the dining-
room to play cards; the ladies remained in the drawing-room and the
verandah. The last to arrive was Ilyin. He was gloomy, morose, and
looked ill. He sat down in the corner of the sofa and did not move
the whole evening. Usually good-humoured and talkative, this time
he remained silent, frowned, and rubbed his eyebrows. When he
had to answer some question, he gave a forced smile with his upper
lip only, and answered jerkily and irritably. Four or five times he
made some jest, but his jests sounded harsh and cutting. It seemed
to Sofya Petrovna that he was on the verge of hysterics. Only now,
sitting at the piano, she recognized fully for the first time that this
unhappy man was in deadly earnest, that his soul was sick, and that
he could find no rest. For her sake he was wasting the best days of
his youth and his career, spending the last of his money on a
summer villa, abandoning his mother and sisters, and, worst of all,
wearing himself out in an agonizing struggle with himself. From
mere common humanity he ought to be treated seriously.
She recognized all this clearly till it made her heart ache, and if at
that moment she had gone up to him and said to him, “No,” there
would have been a force in her voice hard to disobey. But she did
not go up to him and did not speak—indeed, never thought of doing
so. The pettiness and egoism of youth had never been more patent
in her than that evening. She realized that Ilyin was unhappy, and
that he was sitting on the sofa as though he were on hot coals; she
felt sorry for him, but at the same time the presence of a man who
loved her to distraction, filled her soul with triumph and a sense of
her own power. She felt her youth, her beauty, and her unassailable
virtue, and, since she had decided to go away, gave herself full
licence for that evening. She flirted, laughed incessantly, sang with
peculiar feeling and gusto. Everything delighted and amused her.
She was amused at the memory of what had happened at the seat
in the wood, of the sentinel who had looked on. She was amused by
her guests, by Ilyin’s cutting jests, by the pin in his cravat, which she
had never noticed before. There was a red snake with diamond eyes
on the pin; this snake struck her as so amusing that she could have
kissed it on the spot.
Sofya Petrovna sang nervously, with defiant recklessness as
though half intoxicated, and she chose sad, mournful songs which
dealt with wasted hopes, the past, old age, as though in mockery of
another’s grief. “‘And old age comes nearer and nearer’ . . .” she
sang. And what was old age to her?
“It seems as though there is something going wrong with me,” she
thought from time to time through her laughter and singing.
The party broke up at twelve o’clock. Ilyin was the last to leave.
Sofya Petrovna was still reckless enough to accompany him to the
bottom step of the verandah. She wanted to tell him that she was
going away with her husband, and to watch the effect this news
would produce on him.
The moon was hidden behind the clouds, but it was light enough
for Sofya Petrovna to see how the wind played with the skirts of his
overcoat and with the awning of the verandah. She could see, too,
how white Ilyin was, and how he twisted his upper lip in the effort to
smile.
“Sonia, Sonitchka . . . my darling woman!” he muttered,
preventing her from speaking. “My dear! my sweet!”
In a rush of tenderness, with tears in his voice, he showered
caressing words upon her, that grew tenderer and tenderer, and
even called her “thou,” as though she were his wife or mistress.
Quite unexpectedly he put one arm round her waist and with the
other hand took hold of her elbow.
“My precious! my delight!” he whispered, kissing the nape of her
neck; “be sincere; come to me at once!”
She slipped out of his arms and raised her head to give vent to
her indignation and anger, but the indignation did not come off, and
all her vaunted virtue and chastity was only sufficient to enable her
to utter the phrase used by all ordinary women on such occasions:
“You must be mad.”
“Come, let us go,” Ilyin continued. “I felt just now, as well as at
the seat in the wood, that you are as helpless as I am, Sonia . . . .
You are in the same plight! You love me and are fruitlessly trying to
appease your conscience. . . .”
Seeing that she was moving away, he caught her by her lace cuff
and said rapidly:
“If not today, then tomorrow you will have to give in! Why, then,
this waste of time? My precious, darling Sonia, the sentence is
passed; why put off the execution? Why deceive yourself?”
Sofya Petrovna tore herself from him and darted in at the door.
Returning to the drawing-room, she mechanically shut the piano,
looked for a long time at the music-stand, and sat down. She could
not stand up nor think. All that was left of her excitement and
recklessness was a fearful weakness, apathy, and dreariness. Her
conscience whispered to her that she had behaved badly, foolishly,
that evening, like some madcap girl—that she had just been
embraced on the verandah, and still had an uneasy feeling in her
waist and her elbow. There was not a soul in the drawing-room;
there was only one candle burning. Madame Lubyantsev sat on the
round stool before the piano, motionless, as though expecting
something. And as though taking advantage of the darkness and her
extreme lassitude, an oppressive, overpowering desire began to
assail her. Like a boa-constrictor it gripped her limbs and her soul,
and grew stronger every second, and no longer menaced her as it
had done, but stood clear before her in all its nakedness.
She sat for half an hour without stirring, not restraining herself
from thinking of Ilyin, then she got up languidly and dragged herself
to her bedroom. Andrey Ilyitch was already in bed. She sat down by
the open window and gave herself up to desire. There was no
“tangle” now in her head; all her thoughts and feelings were bent
with one accord upon a single aim. She tried to struggle against it,
but instantly gave it up. . . . She understood now how strong and
relentless was the foe. Strength and fortitude were needed to
combat him, and her birth, her education, and her life had given her
nothing to fall back upon.
“Immoral wretch! Low creature!” she nagged at herself for her
weakness. “So that’s what you’re like!”
Her outraged sense of propriety was moved to such indignation by
this weakness that she lavished upon herself every term of abuse
she knew, and told herself many offensive and humiliating truths.
So, for instance, she told herself that she never had been moral, that
she had not come to grief before simply because she had had no
opportunity, that her inward conflict during that day had all been a
farce. . . .
“And even if I have struggled,” she thought, “what sort of struggle
was it? Even the woman who sells herself struggles before she
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like