100% found this document useful (17 votes)
59 views

A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with Applications in Data Analysis and Statistics Gayathri Rajagopalan All Chapters Instant Download

Rajagopalan

Uploaded by

berkssacul
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (17 votes)
59 views

A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with Applications in Data Analysis and Statistics Gayathri Rajagopalan All Chapters Instant Download

Rajagopalan

Uploaded by

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

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

A Python Data Analyst’s Toolkit: Learn Python and


Python-based Libraries with Applications in Data
Analysis and Statistics Gayathri Rajagopalan

https://textbookfull.com/product/a-python-data-analysts-
toolkit-learn-python-and-python-based-libraries-with-
applications-in-data-analysis-and-statistics-gayathri-
rajagopalan/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


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

Data Analysis from Scratch with Python Peters Morgan

https://textbookfull.com/product/data-analysis-from-scratch-with-
python-peters-morgan/

textboxfull.com

Data Analysis with Python and PySpark (MEAP V07) Jonathan


Rioux

https://textbookfull.com/product/data-analysis-with-python-and-
pyspark-meap-v07-jonathan-rioux/

textboxfull.com

Python for Data Analysis Data Wrangling with Pandas NumPy


and IPython Wes Mckinney

https://textbookfull.com/product/python-for-data-analysis-data-
wrangling-with-pandas-numpy-and-ipython-wes-mckinney/

textboxfull.com

Python Data Analysis: Perform data collection, data


processing, wrangling, visualization, and model building
using Python 3rd Edition Avinash Navlani
https://textbookfull.com/product/python-data-analysis-perform-data-
collection-data-processing-wrangling-visualization-and-model-building-
using-python-3rd-edition-avinash-navlani/
textboxfull.com
Practical Python Data Visualization: A Fast Track Approach
To Learning Data Visualization With Python Ashwin Pajankar

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

Python 2 and 3 Compatibility: With Six and Python-Future


Libraries Nanjekye

https://textbookfull.com/product/python-2-and-3-compatibility-with-
six-and-python-future-libraries-nanjekye/

textboxfull.com

Learning Data Mining with Python Layton

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

textboxfull.com

A Tour Of Data Science: Learn R And Python In Parallel


Nailong Zhang

https://textbookfull.com/product/a-tour-of-data-science-learn-r-and-
python-in-parallel-nailong-zhang/

textboxfull.com

Hands-on Scikit-Learn for machine learning applications:


data science fundamentals with Python David Paper

https://textbookfull.com/product/hands-on-scikit-learn-for-machine-
learning-applications-data-science-fundamentals-with-python-david-
paper/
textboxfull.com
A Python Data
Analyst’s Toolkit
Learn Python and Python-based
Libraries with Applications in Data
Analysis and Statistics

Gayathri Rajagopalan
A Python Data
Analyst’s Toolkit
Learn Python and Python-based
Libraries with Applications in Data
Analysis and Statistics

Gayathri Rajagopalan
A Python Data Analyst’s Toolkit: Learn Python and Python-based Libraries with
Applications in Data Analysis and Statistics
Gayathri Rajagopalan

ISBN-13 (pbk): 978-1-4842-6398-3 ISBN-13 (electronic): 978-1-4842-6399-0


https://doi.org/10.1007/978-1-4842-6399-0

Copyright © 2021 by Gayathri Rajagopalan


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Aditee Mirashi
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
[email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-6398-3. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
This book is dedicated to my daughter.
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv


Acknowledgments�������������������������������������������������������������������������������������������������xvii

Introduction������������������������������������������������������������������������������������������������������������xix

Chapter 1: Getting Familiar with Python������������������������������������������������������������������ 1


Technical requirements����������������������������������������������������������������������������������������������������������������� 1
Getting started with Jupyter notebooks���������������������������������������������������������������������������������������� 2
Shortcuts and other features in Jupyter���������������������������������������������������������������������������������� 5
Tab Completion������������������������������������������������������������������������������������������������������������������������ 7
Magic commands used in Jupyter������������������������������������������������������������������������������������������ 7
Python Basics������������������������������������������������������������������������������������������������������������������������������� 8
Comments, print, and input����������������������������������������������������������������������������������������������������� 8
Variables and Constants�������������������������������������������������������������������������������������������������������� 11
Operators������������������������������������������������������������������������������������������������������������������������������� 12
Data types����������������������������������������������������������������������������������������������������������������������������� 15
Working with Strings������������������������������������������������������������������������������������������������������������� 20
Conditional statements���������������������������������������������������������������������������������������������������������� 25
Loops������������������������������������������������������������������������������������������������������������������������������������� 26
Functions������������������������������������������������������������������������������������������������������������������������������� 29
Syntax errors and exceptions����������������������������������������������������������������������������������������������������� 31
Working with files����������������������������������������������������������������������������������������������������������������������� 32
Reading from a file���������������������������������������������������������������������������������������������������������������� 33
Writing to a file���������������������������������������������������������������������������������������������������������������������� 34
Modules in Python���������������������������������������������������������������������������������������������������������������������� 35

v
Table of Contents

Python Enhancement Proposal (PEP) 8 – standards for writing code����������������������������������������� 36


Summary������������������������������������������������������������������������������������������������������������������������������������ 38
Review Exercises������������������������������������������������������������������������������������������������������������������������ 39

Chapter 2: Exploring Containers, Classes, and Objects������������������������������������������ 45


Containers����������������������������������������������������������������������������������������������������������������������������������� 45
Lists��������������������������������������������������������������������������������������������������������������������������������������� 45
Tuples������������������������������������������������������������������������������������������������������������������������������������ 56
Dictionaries��������������������������������������������������������������������������������������������������������������������������� 59
Sets��������������������������������������������������������������������������������������������������������������������������������������� 63
Object-oriented programming���������������������������������������������������������������������������������������������������� 65
Object-oriented programming principles������������������������������������������������������������������������������ 67
Summary������������������������������������������������������������������������������������������������������������������������������������ 70
Review Exercises������������������������������������������������������������������������������������������������������������������������ 71

Chapter 3: Regular Expressions and Math with Python����������������������������������������� 77


Regular expressions������������������������������������������������������������������������������������������������������������������� 77
Steps for solving problems with regular expressions����������������������������������������������������������� 77
Python functions for regular expressions������������������������������������������������������������������������������ 79
Using Sympy for math problems������������������������������������������������������������������������������������������������� 86
Factorization of an algebraic expression������������������������������������������������������������������������������� 86
Solving algebraic equations (for one variable)���������������������������������������������������������������������� 87
Solving simultaneous equations (for two variables)�������������������������������������������������������������� 87
Solving expressions entered by the user������������������������������������������������������������������������������� 88
Solving simultaneous equations graphically������������������������������������������������������������������������� 89
Creating and manipulating sets��������������������������������������������������������������������������������������������� 90
Union and intersection of sets����������������������������������������������������������������������������������������������� 90
Finding the probability of an event���������������������������������������������������������������������������������������� 91
Solving questions in calculus������������������������������������������������������������������������������������������������ 92
Summary������������������������������������������������������������������������������������������������������������������������������������ 94
Review Exercises������������������������������������������������������������������������������������������������������������������������ 95

vi
Table of Contents

Chapter 4: Descriptive Data Analysis Basics�������������������������������������������������������� 101


Descriptive data analysis - Steps��������������������������������������������������������������������������������������������� 101
Structure of data����������������������������������������������������������������������������������������������������������������������� 104
Classifying data into different levels����������������������������������������������������������������������������������������� 104
Visualizing various levels of data���������������������������������������������������������������������������������������������� 106
Plotting mixed data������������������������������������������������������������������������������������������������������������� 110
Summary���������������������������������������������������������������������������������������������������������������������������������� 113
Review Exercises���������������������������������������������������������������������������������������������������������������������� 113

Chapter 5: Working with NumPy Arrays��������������������������������������������������������������� 117


Getting familiar with arrays and NumPy functions������������������������������������������������������������������� 117
Creating an array���������������������������������������������������������������������������������������������������������������������� 118
Reshaping an array������������������������������������������������������������������������������������������������������������� 121
Combining arrays���������������������������������������������������������������������������������������������������������������� 125
Testing for conditions���������������������������������������������������������������������������������������������������������� 127
Broadcasting, vectorization, and arithmetic operations������������������������������������������������������������ 130
Obtaining the properties of an array����������������������������������������������������������������������������������������� 133
Slicing or selecting a subset of data����������������������������������������������������������������������������������������� 136
Obtaining descriptive statistics/aggregate measures�������������������������������������������������������������� 138
Matrices������������������������������������������������������������������������������������������������������������������������������������ 140
Summary���������������������������������������������������������������������������������������������������������������������������������� 140
Review Exercises���������������������������������������������������������������������������������������������������������������������� 141

Chapter 6: Prepping Your Data with Pandas��������������������������������������������������������� 147


Pandas at a glance�������������������������������������������������������������������������������������������������������������������� 147
Technical requirements������������������������������������������������������������������������������������������������������������� 149
Building blocks of Pandas��������������������������������������������������������������������������������������������������������� 149
Examining the properties of a Series���������������������������������������������������������������������������������������� 152
DataFrames������������������������������������������������������������������������������������������������������������������������������� 156
Creating DataFrames by importing data from other formats���������������������������������������������� 158
Accessing attributes in a DataFrame���������������������������������������������������������������������������������� 160
Modifying DataFrame objects���������������������������������������������������������������������������������������������� 161
vii
Table of Contents

Indexing������������������������������������������������������������������������������������������������������������������������������������ 169
Type of an index object�������������������������������������������������������������������������������������������������������� 170
Creating a custom index and using columns as indexes���������������������������������������������������� 171
Indexes and speed of data retrieval������������������������������������������������������������������������������������ 173
Immutability of an index������������������������������������������������������������������������������������������������������ 174
Alignment of indexes����������������������������������������������������������������������������������������������������������� 176
Set operations on indexes��������������������������������������������������������������������������������������������������� 177
Data types in Pandas���������������������������������������������������������������������������������������������������������������� 178
Obtaining information about data types������������������������������������������������������������������������������ 179
Indexers and selection of subsets of data�������������������������������������������������������������������������������� 182
Understanding loc and iloc indexers����������������������������������������������������������������������������������� 183
Other (less commonly used) indexers for data access�������������������������������������������������������� 188
Boolean indexing for selecting subsets of data������������������������������������������������������������������� 192
Using the query method to retrieve data����������������������������������������������������������������������������� 192
Operators in Pandas������������������������������������������������������������������������������������������������������������������ 193
Representing dates and times in Pandas��������������������������������������������������������������������������������� 194
Converting strings into Pandas Timestamp objects������������������������������������������������������������ 195
Extracting the components of a Timestamp object������������������������������������������������������������� 196
Grouping and aggregation�������������������������������������������������������������������������������������������������������� 197
Examining the properties of the groupby object����������������������������������������������������������������� 199
Filtering groups������������������������������������������������������������������������������������������������������������������� 201
Transform method and groupby������������������������������������������������������������������������������������������ 202
Apply method and groupby������������������������������������������������������������������������������������������������� 204
How to combine objects in Pandas������������������������������������������������������������������������������������������� 204
Append method for adding rows����������������������������������������������������������������������������������������� 205
Concat function (adding rows or columns from other objects)������������������������������������������� 207
Join method – index to index���������������������������������������������������������������������������������������������� 210
Merge method – SQL type join based on common columns����������������������������������������������� 211

viii
Table of Contents

Restructuring data and dealing with anomalies����������������������������������������������������������������������� 213


Dealing with missing data��������������������������������������������������������������������������������������������������� 214
Data duplication������������������������������������������������������������������������������������������������������������������ 218
Tidy data and techniques for restructuring data����������������������������������������������������������������������� 220
Conversion from wide to long format (tidy data)����������������������������������������������������������������� 221
Stack method (wide-to-long format conversion)���������������������������������������������������������������� 223
Melt method (wide-to-long format conversion)������������������������������������������������������������������ 226
Pivot method (long-to-wide conversion)����������������������������������������������������������������������������� 228
Summary���������������������������������������������������������������������������������������������������������������������������������� 229
Review Exercises���������������������������������������������������������������������������������������������������������������������� 230

Chapter 7: Data Visualization with Python Libraries�������������������������������������������� 243


Technical requirements������������������������������������������������������������������������������������������������������������� 243
External files������������������������������������������������������������������������������������������������������������������������ 244
Commonly used plots���������������������������������������������������������������������������������������������������������������� 245
Matplotlib���������������������������������������������������������������������������������������������������������������������������������� 248
Approach for plotting using Matplotlib�������������������������������������������������������������������������������� 251
Plotting using Pandas��������������������������������������������������������������������������������������������������������������� 253
Scatter plot�������������������������������������������������������������������������������������������������������������������������� 254
Histogram���������������������������������������������������������������������������������������������������������������������������� 255
Pie charts���������������������������������������������������������������������������������������������������������������������������� 256
Seaborn library������������������������������������������������������������������������������������������������������������������������� 257
Box plots������������������������������������������������������������������������������������������������������������������������������ 258
Adding arguments to any Seaborn plotting function����������������������������������������������������������� 259
Kernel density estimate������������������������������������������������������������������������������������������������������� 259
Violin plot����������������������������������������������������������������������������������������������������������������������������� 260
Count plots�������������������������������������������������������������������������������������������������������������������������� 261
Heatmap������������������������������������������������������������������������������������������������������������������������������ 262
Facet grid���������������������������������������������������������������������������������������������������������������������������� 263
Regplot�������������������������������������������������������������������������������������������������������������������������������� 265

ix
Table of Contents

lmplot���������������������������������������������������������������������������������������������������������������������������������� 266
Strip plot������������������������������������������������������������������������������������������������������������������������������ 267
Swarm plot�������������������������������������������������������������������������������������������������������������������������� 268
Catplot��������������������������������������������������������������������������������������������������������������������������������� 269
Pair plot������������������������������������������������������������������������������������������������������������������������������� 270
Joint plot������������������������������������������������������������������������������������������������������������������������������ 272
Summary���������������������������������������������������������������������������������������������������������������������������������� 273
Review Exercises���������������������������������������������������������������������������������������������������������������������� 274

Chapter 8: Data Analysis Case Studies����������������������������������������������������������������� 279


Technical requirements������������������������������������������������������������������������������������������������������������� 279
Methodology����������������������������������������������������������������������������������������������������������������������������� 280
Case study 8-1: Highest grossing movies in France – analyzing unstructured data���������������� 281
Case study 8-2: Use of data analysis for air quality management�������������������������������������������� 288
Case study 8-3: Worldwide COVID-19 cases – an analysis������������������������������������������������������� 308
Summary���������������������������������������������������������������������������������������������������������������������������������� 320
Review Exercises���������������������������������������������������������������������������������������������������������������������� 321

Chapter 9: Statistics and Probability with Python����������������������������������������������� 325


Permutations and combinations����������������������������������������������������������������������������������������������� 325
Probability��������������������������������������������������������������������������������������������������������������������������������� 327
Rules of probability�������������������������������������������������������������������������������������������������������������� 328
Conditional probability��������������������������������������������������������������������������������������������������������� 330
Bayes theorem�������������������������������������������������������������������������������������������������������������������������� 330
Application of Bayes theorem in medical diagnostics��������������������������������������������������������� 331
Another application of Bayes theorem: Email spam classification�������������������������������������� 333
SciPy library������������������������������������������������������������������������������������������������������������������������������ 334
Probability distributions������������������������������������������������������������������������������������������������������������ 335
Binomial distribution����������������������������������������������������������������������������������������������������������� 335
Poisson distribution������������������������������������������������������������������������������������������������������������� 338
Continuous probability distributions������������������������������������������������������������������������������������ 341

x
Table of Contents

Normal distribution�������������������������������������������������������������������������������������������������������������� 341


Standard normal distribution����������������������������������������������������������������������������������������������� 343
Measures of central tendency��������������������������������������������������������������������������������������������������� 347
Measures of dispersion������������������������������������������������������������������������������������������������������������� 348
Measures of shape�������������������������������������������������������������������������������������������������������������������� 349
Sampling����������������������������������������������������������������������������������������������������������������������������������� 353
Probability sampling������������������������������������������������������������������������������������������������������������ 353
Non-probability sampling���������������������������������������������������������������������������������������������������� 354
Central limit theorem���������������������������������������������������������������������������������������������������������������� 355
Estimates and confidence intervals������������������������������������������������������������������������������������ 356
Types of errors in sampling������������������������������������������������������������������������������������������������������� 357
Hypothesis testing�������������������������������������������������������������������������������������������������������������������� 358
Basic concepts in hypothesis testing���������������������������������������������������������������������������������� 358
Key terminology used in hypothesis testing������������������������������������������������������������������������ 359
Steps involved in hypothesis testing����������������������������������������������������������������������������������� 361
One-sample z-test�������������������������������������������������������������������������������������������������������������������� 362
Two-sample sample z-test�������������������������������������������������������������������������������������������������������� 364
Hypothesis tests with proportions�������������������������������������������������������������������������������������������� 366
Two-sample z-test for the population proportions�������������������������������������������������������������� 368
T-distribution����������������������������������������������������������������������������������������������������������������������������� 370
One sample t-test���������������������������������������������������������������������������������������������������������������� 372
Two-sample t-test��������������������������������������������������������������������������������������������������������������� 372
Two-sample t-test for paired samples�������������������������������������������������������������������������������� 373
Solved examples: Conducting t-tests using Scipy functions���������������������������������������������������� 373
ANOVA��������������������������������������������������������������������������������������������������������������������������������������� 376
Chi-square test of association�������������������������������������������������������������������������������������������������� 379
Summary���������������������������������������������������������������������������������������������������������������������������������� 383
Review Exercises���������������������������������������������������������������������������������������������������������������������� 386

Index��������������������������������������������������������������������������������������������������������������������� 393

xi
About the Author
Gayathri Rajagopalan works for a leading Indian
multinational organization, with ten years of experience
in the software and information technology industry.
She has degrees in computer engineering and business
adminstration, and is a certified Project Management
Professional (PMP). Some of her key focus areas include
Python, data analytics, machine learning, statistics, and
deep learning. She is proficient in Python, Java, and C/C++
programming. Her hobbies include reading, music, and
teaching programming and data science to beginners.

xiii
About the Technical Reviewer
Manohar Swamynathan is a data science practitioner
and an avid programmer, with over 14 years of experience
in various data science related areas that include data
warehousing, Business Intelligence (BI), analytical tool
development, ad hoc analysis, predictive modeling, data
science product development, consulting, formulating
strategy, and executing analytics programs. He’s had a
career covering the life cycle of data across different
domains such as US mortgage banking, retail/ecommerce,
insurance, and industrial IoT. He has a bachelor’s degree
with a specialization in physics, mathematics, and
computers, and a master’s degree in project management. He’s currently living in
Bengaluru, the Silicon Valley of India.

xv
Acknowledgments
This book is a culmination of a year-long effort and would not have been possible
without my family’s support. I am indebted to them for their patience, kindness, and
encouragement.

I would also like to thank my readers for investing their time and money in this book. It is
my sincere hope that this book adds value to your learning experience.

xvii
Introduction
I had two main reasons for writing this book. When I first started learning data science,
I could not find a centralized overview of all the important topics on this subject.
A practitioner of data science needs to be proficient in at least one programming
language, learn the various aspects of data preparation and visualization, and also
be conversant with various aspects of statistics. The goal of this book is to provide
a consolidated resource that ties these interconnected disciplines together and
introduces these topics to the learner in a graded manner. Secondly, I wanted to provide
material to help readers appreciate the practical aspects of the seemingly abstract
concepts in data science, and also help them to be able to retain what they have learned.
There is a section on case studies to demonstrate how data analysis skills can be applied
to make informed decisions to solve real-world challenges. One of the highlights of
this book is the inclusion of practice questions and multiple-choice questions to help
readers practice and apply whatever they have learned. Most readers read a book and
then forget what they have read or learned, and the addition of these exercises will help
readers avoid this pitfall.

The book helps readers learn three important topics from scratch – the Python
programming language, data analysis, and statistics. It is a self-contained introduction
for anybody looking to start their journey with data analysis using Python, as it focuses
not just on theory and concepts but on practical applications and retention of concepts.
This book is meant for anybody interested in learning Python and Python-based libraries
like Pandas, Numpy, Scipy, and Matplotlib for descriptive data analysis, visualization,
and statistics. The broad categories of skills that readers learn from this book include
programming skills, analytical skills, and problem-solving skills.

The book is broadly divided into three parts – programming with Python, data analysis
and visualization, and statistics. The first part of the book comprises three chapters. It
starts with an introduction to Python – the syntax, functions, conditional statements,
data types, and different types of containers. Subsequently, we deal with advanced
concepts like regular expressions, handling of files, and solving mathematical problems

xix
Introduction

with Python. Python is covered in detail before moving on to data analysis to ensure that
the readers are comfortable with the programming language before they learn how to
use it for purposes of data analysis.

The second part of the book, comprising five chapters, covers the various aspects of
descriptive data analysis, data wrangling and visualization, and the respective Python
libraries used for each of these. There is an introductory chapter covering basic concepts
and terminology in data analysis, and one chapter each on NumPy (the scientific
computation library), Pandas (the data wrangling library), and the visualization
libraries (Matplotlib and Seaborn). A separate chapter is devoted to case studies to
help readers understand some real-world applications of data analysis. Among these
case studies is one on air pollution, using data drawn from an air quality monitoring
station in New Delhi, which has seen alarming levels of pollution in recent years. This
case study examines the trends and patterns of major air pollutants like sulfur dioxide,
nitrogen dioxide, and particulate matter for five years, and comes up with insights and
recommendations that would help with designing mitigation strategies.

The third section of this book focuses on statistics, elucidating important principles in
statistics that are relevant to data science. The topics covered include probability, Bayes
theorem, permutations and combinations, hypothesis testing (ANOVA, chi-­squared
test, z-test, and t-test), and the use of various functions in the Scipy library to enable
simplification of tedious calculations involved in statistics.

By the end of this book, the reader will be able to confidently write code in Python, use
various Python libraries and functions for analyzing any dataset, and understand basic
statistical concepts and tests. The code is presented in the form of Jupyter notebooks
that can further be adapted and extended. Readers get the opportunity to test their
understanding with a combination of multiple-choice and coding questions. They
also get an idea about how to use the skills and knowledge they have learned to make
evidence-based decisions for solving real-world problems with the help of case studies.

xx
CHAPTER 1

Getting Familiar
with Python
Python is an open source programming language created by a Dutch programmer
named Guido van Rossum. Named after the British comedy group Monty Python,
Python is a high-level, interpreted, open source language and is one of the most sought-
after and rapidly growing programming languages in the world today. It is also the
language of preference for data science and machine learning.

In this chapter, we first introduce the Jupyter notebook – a web application for running
code in Python. We then cover the basic concepts in Python, including data types,
operators, containers, functions, classes and file handling and exception handling, and
standards for writing code and modules.

The code examples for this book have been written using Python version 3.7.3 and
Anaconda version 4.7.10.

T echnical requirements
Anaconda is an open source platform used widely by Python programmers and data
scientists. Installing this platform installs Python, the Jupyter notebook application, and
hundreds of libraries. The following are the steps you need to follow for installing the
Anaconda distribution.

1. Open the following URL: https://www.anaconda.com/products/


individual

2. Click the installer for your operating system, as shown in Figure 1-1.
The installer gets downloaded to your system.

1
© Gayathri Rajagopalan 2021
G. Rajagopalan, A Python Data Analyst’s Toolkit, https://doi.org/10.1007/978-1-4842-6399-0_1
Chapter 1 Getting Familiar with Python

Figure 1-1. Installing Anaconda

3. Open the installer (file downloaded in the previous step) and run it.

4. After the installation is complete, open the Jupyter application


by typing “jupyter notebook” or “jupyter” in the explorer (search
bar) next to the start menu, as shown in Figure 1-2 (shown for
Windows OS).

Figure 1-2. Launching Jupyter

Please follow the following steps for downloading all the data files used in this book:

• Click the following link: https://github.com/DataRepo2019/


Data-files
• Select the green “Code” menu and click on “Download ZIP” from the
dropdown list of this menu
• Extract the files from the downloaded zip folder and import these
files into your Jupyter application

Now that we have installed and launched Jupyter, let us understand how to use this
application in the next section.

Getting started with Jupyter notebooks


Before we discuss the essentials of Jupyter notebooks, let us discuss what an integrated
development environment (or IDE) is. An IDE brings together the various activities
involved in programming, like including writing and editing code, debugging, and
2
Chapter 1 Getting Familiar with Python

creating executables. It also includes features like autocompletion (completing what


the user wants to type, thus enabling the user to focus on logic and problem-solving)
and syntax highlighting (highlighting the various elements and keywords of the
language). There are many IDEs for Python, apart from Jupyter, including Enthought
Canopy, Spyder, PyCharm, and Rodeo. There are several reasons for Jupyter becoming
a ubiquitous, de facto standard in the data science community. These include ease
of use and customization, support for several programming languages, platform
independence, facilitation of access to remote data, and the benefit of combining output,
code, and multimedia under one roof.

JupyterLab is the IDE for Jupyter notebooks. Jupyter notebooks are web applications that
run locally on a user’s machine. They can be used for loading, cleaning, analyzing, and
modeling data. You can add code, equations, images, and markdown text in a Jupyter
notebook. Jupyter notebooks serve the dual purpose of running your code as well as
serving as a platform for presenting and sharing your work with others. Let us look at the
various features of this application.

1. Opening the dashboard

Type “jupyter notebook” in the search bar next to the start menu.
This will open the Jupyter dashboard. The dashboard can be used
to create new notebooks or open an existing one.

2. Creating a new notebook

Create a new Jupyter notebook by selecting New from the upper


right corner of the Jupyter dashboard and then select Python 3
from the drop-down list that appears, as shown in Figure 1-3.

Figure 1-3. Creating a new Jupyter notebook

3. Entering and executing code

Click inside the first cell in your notebook and type a simple line
of code, as shown in Figure 1-4. Execute the code by selecting Run
Cells from the “Cell” menu, or use the shortcut keys Ctrl+Enter.
3
Chapter 1 Getting Familiar with Python

Figure 1-4. Simple code statement in a Jupyter cell

4. Adding markdown text or headings


In the new cell, change the formatting by selecting Markdown
as shown in Figure 1-5, or by pressing the keys Esc+M on your
keyboard. You can also add a heading to your Jupyter notebook by
selecting Heading from the drop-down list shown in the following
or pressing the shortcut keys Esc+(1/2/3/4).

Figure 1-5. Changing the mode to Markdown

5. Renaming a notebook
Click the default name of the notebook and type a new name, as
shown in Figure 1-6.

Figure 1-6. Changing the name of a file

You can also rename a notebook by selecting File ➤ Rename.


6. Saving a notebook
Press Ctrl+S or choose File ➤ Save and Checkpoint.
7. Downloading the notebook
You can email or share your notebook by downloading your
notebook using the option File ➤ Download as ➤ notebook
(.ipynb), as shown in Figure 1-7.
4
Chapter 1 Getting Familiar with Python

Figure 1-7. Downloading a Jupyter notebook

Shortcuts and other features in Jupyter


Let us look at some key features of Jupyter notebooks, including shortcuts, tab
completions, and magic commands.

Table 1-1 gives some of the familiar icons found in Jupyter notebooks, the corresponding
menu functions, and the keyboard shortcuts.

5
Chapter 1 Getting Familiar with Python

Table 1-1. Jupyter Notebook Toolbar Functions


Icon in Toolbar Function Keyboard shortcut Menu function

Saving a Jupyter notebook Esc+s File ➤ Save as

Adding a new cell to a Esc+b (adding a cell below the Insert ➤ Insert Cell
Jupyter notebook current cell), or Esc+a (adding Above or Insert ➤
a cell above the current cell) Insert Cell Below

Cutting a selected cell Esc+x Edit ➤ Cut Cells

Copying the selected cell Esc+c Edit ➤ Copy Cells

Pasting a cell above or Esc+v Edit ➤ Paste Cells


below another selected cell Above or Edit ➤
Paste Cells Below

Running a given cell Ctrl+Enter (to run selected cell); Cell ➤ Run
Shift+Enter (to run selected cell Selected Cells
and insert a new cell)

Interrupting the kernel Esc+ii Kernel ➤ Interrupt

Rebooting the kernel Esc+00 Kernel ➤ Restart

If you are not sure about which keyboard shortcut to use, go to: Help ➤ Keyboard
Shortcuts, as shown in Figure 1-8.

Figure 1-8. Help menu in Jupyter


6
Chapter 1 Getting Familiar with Python

Commonly used keyboard shortcuts include

• Shift+Enter to run the code in the current cell and move to the next
cell.

• Esc to leave a cell.

• Esc+M changes the mode for a cell to “Markdown” mode.

• Esc+Y changes the mode for a cell to “Code”.

T ab Completion
This is a feature that can be used in Jupyter notebooks to help you complete the code
being written. Usage of tab completions can speed up the workflow, reduce bugs, and
quickly complete function names, thus reducing typos and saving you from having to
remember the names of all the modules and functions.

For example, if you want to import the Matplotlib library but don’t remember the
spelling, you could type the first three letters, mat, and press Tab. You would see a drop-
down list, as shown in Figure 1-9. The correct name of the library is the second name in
the drop-down list.

Figure 1-9. Tab completion in Jupyter

Magic commands used in Jupyter


Magic commands are special commands that start with one or more % signs, followed by
a command. The commands that start with one % symbol are applicable for a single line
of code, and those beginning with two % signs are applicable for the entire cell (all lines
of code within a cell).

7
Chapter 1 Getting Familiar with Python

One commonly used magic command, shown in the following, is used to display
Matplotlib graphs inside the notebook. Adding this magic command avoids the need
to call the plt.show function separately for showing graphs (the Matplotlib library is
discussed in detail in Chapter 7).

CODE:

%matplotlib inline

Magic commands, like timeit, can also be used to time the execution of a script, as shown
in the following.

CODE:

%%timeit
for i in range(100000):
    i*i

Output:

16.1 ms ± 283 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)

Now that you understand the basics of using Jupyter notebooks, let us get started with
Python and understand the core aspects of this language.

P
 ython Basics
In this section, we get familiar with the syntax of Python, commenting, conditional
statements, loops, and functions.

Comments, print, and input


In this section, we cover some basics like printing, obtaining input from the user, and
adding comments to help others understand your code.

C
 omments
A comment explains what a line of code does, and is used by programmers to help others
understand the code they have written. In Python, a comment starts with the # symbol.

8
Chapter 1 Getting Familiar with Python

Proper spacing and indentation are critical in Python. While other languages like Java
and C++ use brackets to enclose blocks of code, Python uses an indent of four spaces
to specify code blocks. One needs to take care of indents to avoid errors. Applications
like Jupyter generally take care of indentation and automatically add four spaces at the
beginning of a block of code.

Printing
The print function prints content to the screen or any other output device.

Generally, we pass a combination of strings and variables as arguments to the print


function. Arguments are the values included within the parenthesis of a function, which
the function uses for producing the result. In the following statement, “Hello!” is the
argument to the print function.

CODE:

print("Hello!")

To print multiple lines of code, we use triple quotes at the beginning and end of the
string, for example:

CODE:

print('''Today is a lovely day.


It will be warm and sunny.
It is ideal for hiking.''')

Output:

Today is a lovely day.


It will be warm and sunny.
It is ideal for hiking.

Note that we do not use semicolons in Python to end statements, unlike some other
languages.

The format method can be used in conjunction with the print method for embedding
variables within a string. It uses curly braces as placeholders for variables that are passed
as arguments to the method.

Let us look at a simple example where we print variables using the format method.
9
Chapter 1 Getting Familiar with Python

CODE:

weight=4.5
name="Simi"
print("The weight of {} is {}".format(name,weight))

Output:

The weight of Simi is 4.5

The preceding statement can also be rewritten as follows without the format method:

CODE:

print("The weight of",name,"is","weight")

Note that only the string portion of the print argument is enclosed within quotes. The name
of the variable does not come within quotes. Similarly, if you have any constants in your
print arguments, they also do not come within quotes. In the following example, a Boolean
constant (True), an integer constant (1), and strings are combined in a print statement.

CODE:

print("The integer equivalent of",True,"is",1)

Output:

The integer equivalent of True is 1

The format fields can specify precision for floating-point numbers. Floating-point
numbers are numbers with decimal points, and the number of digits after the decimal
point can be specified using format fields as follows.

CODE:

x=91.234566
print("The value of x upto 3 decimal points is {:.3f}".format(x))

Output:

The value of x upto 3 decimal points is 91.235

We can specify the position of the variables passed to the method. In this example, we
use position “1” to refer to the second object in the argument list, and position “0” to
specify the first object in the argument list.
10
Chapter 1 Getting Familiar with Python

CODE:

y='Jack'
x='Jill'
print("{1} and {0} went up the hill to fetch a pail of water".format(x,y))

Output:

Jack and Jill went up the hill to fetch a pail of water

I nput
The input function accepts inputs from the user. The input provided by the user is stored
as a variable of type String. If you want to do any mathematical calculations with any
numeric input, you need to change the data type of the input to int or float, as follows.

CODE:

age=input("Enter your age:")


print("In 2010, you were",int(age)-10,"years old")

Output:

Enter your age:76


In 2010, you were 66 years old

Further reading on Input/Output in Python: https://docs.python.org/3/tutorial/


inputoutput.html

V
 ariables and Constants
A constant or a literal is a value that does not change, while a variable contains a value
can be changed. We do not have to declare a variable in Python, that is, specify its data
type, unlike other languages like Java and C/C++. We define it by giving the variable a
name and assigning it a value. Based on the value, a data type is automatically assigned
to it. Values are stored in variables using the assignment operator (=). The rules for
naming a variable in Python are as follows:
• a variable name cannot have spaces

• a variable cannot start with a number

11
Chapter 1 Getting Familiar with Python

• a variable name can contain only letters, numbers, and underscore


signs (_)

• a variable cannot take the name of a reserved keyword (for example,


words like class, continue, break, print, etc., which are predefined
terms in the Python language, have special meanings, and are invalid
as variable names)

Operators
The following are some commonly used operators in Python.

Arithmetic operators: Take two integer or float values, perform an operation, and return
a value.

The following arithmetic operators are supported in Python:

• **(Exponent)

• %(modulo or remainder),

• //(quotient),

• *(multiplication)

• -(subtraction)

• +(addition)

The order of operations is essential. Parenthesis takes precedence over exponents,


which takes precedence over division and multiplication, which takes precedence
over addition and subtraction. An acronym was designed - P.E.D.M.A.S.(Please Excuse
My Dear Aunt Sally) - that can be used to remember the order of these operations to
understand which operator first needs to be applied in an arithmetic expression. An
example is given in the following:

CODE:

(1+9)/2-3

Output:

2.0

12
Chapter 1 Getting Familiar with Python

In the preceding expression, the operation inside the parenthesis is performed first,
which gives 10, followed by division, which gives 5, and then subtraction, which gives the
final output as 2.

Comparison operators: These operators compare two values and evaluate to a true or
false value. The following comparison operators are supported in Python:
• >: Greater than
• < : Less than
• <=: Less than or equal to
• >=: Greater than or equal to
• == : equality. Please note that this is different from the assignment
operator (=)
• !=(not equal to)

Logical (or Boolean) operators: Are similar to comparison operators in that they
also evaluate to a true or false value. These operators operate on Boolean variables or
expressions. The following logical operators are supported in Python:

• and operator: An expression in which this operator is used evaluates


to True only if all its subexpressions are True. Otherwise, if any of
them is False, the expression evaluates to False
An example of the usage of the and operator is shown in the following.
CODE:

(2>1) and (1>3)

Output:

False

• or operator: An expression in which the or operator is used, evaluates


to True if any one of the subexpressions within the expression is True.
The expression evaluates to False if all its subexpressions evaluate to
False.
An example of the usage of the or operator is shown in the following.

CODE:

(2>1) or (1>3)
13
Another Random Scribd Document
with Unrelated Content
JASKAN ÄKKIKÄÄNNÖS

Lampimäki ei ollut Jaskaan, nuorimpaan renkiinsä, lainkaan


tyytyväinen.
Ei olisi pitänyt erikoisesti väliä, vaikka Jaska kekriltä olisi
lähtenytkin, vaan ei viitsinyt omasta aloitteestaan sanoa irti. Tekihän
Jaska työnsä siinä, missä joku toinenkin ja oli talossa ihmisiksi.

Mutta Jaska kulki työväentalolla, oli suuri tappelija ja kylillä


ollessaan paha suustaan. Sellaisesta Lampimäki ei välittänyt. Hänen
puolestaan sai itsekukin käydä työväentalolla tai seuroissa, mutta
kun edelliseen vielä liittyi suuri suu ja kärkäs käsi, oli asia
Lampimäen mielestä selvä: mies on sosialisti. Ja sosialisteista
Lampimäellä oli oma mielipiteensä varsinkin nyt.

Kerran oli Jaska päissään toikkeroinut iltajuoksuiltaan tupaan. Oli


sattunut niin ohraisesti, että isäntä oli tullut portailla vastaan,
tarttunut kraiveliin ja kuljettanut Jaskan navetan kokille.

— Ryyppää kun ryyppää, mutta ryyppää ihmisiksi!

Nyt Lampimäki hiljaisessa mielessään arveli, että olisi saanut


vähän isällisemmin ja pehmeämmin työntää Jaskan sinne kokille,
sillä oli kai sillä ollut aiheensakin siihen ryyppäämiseen. Sitäpaitsi
olivat ajat levottomat, sosialistit olivat ryhtyneet kapinaan, eikä
tiennyt, mitä Jaskan päähän saattoi pälkähtää. Yhtenään oli viime
aikoina siellä "talolla" ravannut. Ja vihaisesti oli Jaska siitä
aamuhetkestä asti, kun oli kokilta alas kömpinyt, isäntää katsella
kyrännyt. Ei ollut puhunut mitään, vaan jotakin sillä oli mielessä. Nyt,
kun ne ovat puuhassa…

Tuvassa on hiljaista, vaikka onkin arkipäivä. Viikon kuluessa isäntä


on ollut huomaavinaan, että rengit ovat odottavalla kannalla
johonkin asiaan nähden, josta he itsekään eivät olleet oikein selvillä,
piiat kuiskailivat keskenään, ja Jaska kyräili ja muljotteli entistä
mielenosoituksellisemmin. Nyt ne ovat ulkona töissä, ja vain emäntä
istuu pihaikkunan luona ja katselee hämärissä lehtiä.

Seinäkello lyö harvakseen kolmenlyönnit. On vielä aikaa,


ennenkuin väki alkaa lappautua illalliselle. Mietteissään isäntä
nousee ja alkaa käveleskellä tuvan lattialla edestakaisin.

— Saa nähdä, meinaako ne oikein kapinaa, täälläkin, sanoo hän.

— Hm… vastaa emäntä, nostamatta katsettaan lehdestä.

— Ryssistä niillä on suuri turva, jatkaa isäntä tuokion kuluttua.

Lehti kahisee emännän kädessä, hän laskee sen hetkeksi syrjään


ja korjaa lasejaan.

— Kuuluvat aikovan tulla taloihin syömään ilman edestä, virkahtaa


hänkin puolestaan.

Isäntä naurahtaa katkerasti.


— Viimeinen syönti se heillä on, jos vaan tänne tulevat, mojauttaa
hän sitten varmasti.

— Aseita ovat saaneet ryssiltä, lisää emäntä ikäänkuin


tiedustellen, minkä vaikutuksen se isäntään tekisi.

— Mm… Arvaahan ryssän…

Isännällä ovat omat tietonsa, emännällä omansa, eivätkä


viimeksimainitut näytä isäntään vaikuttavan. Hän ajattelee Jaskaa.
Paha on pitää pirua omassa pesässään, mutta ei viitsi poiskaan
käskeä.
Peloksi selittäisivät.

Ulkona on jo kevään tuntu voittava. Ilma on kirkas, sees ja


rauhallisen odottava, on kuin lumen alta väreilisi ilmaan hienon
hienoa maan tuoksua. Isäntä kävelee ikkunan luo ja pysähtyy kädet
taskuissa katselemaan kevättä ja sitä, mitä tapahtuu ulkona.

Kauppias Lunkkreenin piika kävelee maantiellä ohi, ryssä


kainalossa. Ryssä selittelee ja viittilöi, ja Lunkkreenin piika nauraa ja
on ymmärtäväisen näköinen. Näky ei erikoisesti suututa isäntää: se
on nyt vain Lunkkreenin, kulanssin, piika ja muuan ryssäraukka.
Kaukaisimmassa tajunnassaan isäntä puolittaisella kauhulla huomaa,
ettei hän pidä ryssää oikein ihmisenä. "Mikä lie sellainen Jumalan
firaapelityö".

Tuon lauseen on isäntä kuullut Jaskalta. Ja yht'äkkiä, tämän


tullessa mieleen, alkavat isännän mielipiteet Jaskasta vaihdella.

— Firaapelityö! Raa'asti sanottu, — oikein Jaskan malliin. Ei se


ryssien kanssa samalle puolelle ainakaan… tai mikä sen tietää…
Maantiellä on yhtämittaista liikettä. Kuormia menee ja tulee, ryssät
kulkevat toimeliaina edestakaisin, useilla naisia kintereillään. Tuolla
menee Nevasen tyttö ryssän kanssa, narttu ihmiseksi, ja isä
koiranpenikka talolliseksi… Lampimäen isäntä ei syljeskele lattialle,
mutta nyt hän ruiskauttaa pitkän syljen ajatellessaan Nevasen
sakkia…

Jotakin niillä on tekeillä. "Talolle" syttyvät tulet, pihalla kihistään ja


kuhistaan, melu ja huudot kuuluvat Lampimäkeen asti. Hiukkaista
myöhemmin ilmestyvät valot Peltoniemen pitkiin ikkunariveihin ja
nuorisoseuran talolle. Itsetiedoton hymy ilmestyy isännän suupieliin.
Hyvä tulee, oikein hyvä. Häntä melkein naurattaa, kun hän näkee
miehiä, punainen nauha käsivarressa, sekaisina ryhminä
kuljeskelevan talon ohi.

Hän aikoo juuri ruveta antamaan emännälle eräitä selityksiä, kun


Suuriniemen Matti astuu sisään. Suuriniemi on ajanut pihalle
takapihan kautta eikä isäntä ole hänen tuloaan aikaisemmin
huomannut.

— Iltaa, tervehtii Suuriniemi, pannen lakkinsa takkakivelle.

— Iltaa.

— No nyt se alkaa olla valmista, sanoo hän sitten reippaasti,


huomattuaan, ettei tuvassa ole syrjäisiä.

— Jokos jääkäri tuli?

— Tuli jo aamulla.

— Missäs se…?
— Peltoniemessä.

— Jaa.

Emäntä alkaa laittaa kahvipannua tulelle. Tuntuu kuin olisi


Suuriniemi tullessaan tuonut tupaan hiukan enemmän
toimeliaisuutta ja odottavan toivon tunnelmaa.

— Sinä tulet sitten yöllä? kysyy Suuriniemi.

— Niinhän sitä sovittiin.

— Tulet sitten Peltoniemeen. Osa menee seuran talolle ja osa


meille.

— Tullaanpa vaan.

Emäntä nostaa kahvipannun tulelta ja sekaantuu keskusteluun.

— Meinaatteko te nyt sitten, että se käy niin rauhallisesti ja


niinkuin olette suunnitelleet? kysyy hän.

Suuriniemi naurahtaa hiljaisesti.

— Jos jotakin tulee, vastaa hän, niin tulee samanveroinen kun


kyläkunnan rytinät entisaikaan. Virkistyksekseen niissä heilahtelee.

— Mutta jos niillä on jotakin hajua…?

— Kyllä kai niillä hajua on — ei sen puolesta. Koko talven ja viime


syksynhän ovat niistä hajuistaan räikyttäneet. Mutta eipä taida…

Suuriniemi ei sano ajatustaan loppuun. Porstuasta kuuluu kolinaa


ja hetken kuluttua tulee Jaska sisään. Hän tuoksuu huomattavasti
väkeville, hänellä on kivääri pistimineen kädessä ja leveä, punainen
nauha käsivarressa.

Vaistomaisesti Suuriniemi korjaa lakkinsa, ja Lampimäki ottaa


piipun hampaistaan.

— Mitäs kojeita sinä tänne haalaat? kysyy hän terävästi.

— Kivääri se on, vastaa Jaska leveästi. Eikös isäntä ole ennen


sellaista nähnyt?

Jaska on nuori mies, hiukan yli kahdenkymmenen, mutta vähän


villin ja kesyttömän näköinen.

— Vai kivääri! toistaa isäntä. Mitäs sillä?

— Sittenpähän näkyy.

— Entä mikäs se on tuo punainen nauha?

— Se on kaartin merkki.

Jaska menee remsseesti pöydän taakse ja alkaa nurkkakaapista


hakea jotakin.

— Eiköhän ole parasta, puuttuu Suuriniemi puheeseen, että Jaska


vie ne vehkeet takaisin sinne, mistä on ne saanutkin. Ei niistä
perältäkään mitään siunausta lähde.

— Sittenpähän lähtee se, mikä lähtee, virkahtaa Jaska kyräillen


uhkamielisesti ja luo vihaisen katseen isäntään. — Tuota… jatkaa
hän vähän ajan kuluttua, saisikohan ruokaa hiukan aikaisemmin, kun
olisi illalla vähän omia puuhia?
— Kyllä se on parasta, että Jaska ottaa palkkansa ja lähtee
pitemmäksi aikaa niihin omiin puuhiinsa, sanoo isäntä, avaten
kukkaronsa. Siinä olisi palkan loppu.

Hetkisen näyttää siltä, kuin Jaskan nousuhumala olisi laskemassa,


sitten hän työntää rahat edestään ja sanoo tarkoituksellisen
rauhallisesti:

— Kylläpä isäntä kerkiää niistä asioista puhua parin päivän päästä.

— Tästä talosta ei kuljeta niillä asioilla, jyrähtää Lampimäki. Ota ja


lähde!

— Ei sitä lähdetä niinkuin koira.

— Joko viet vehkeesi takaisin ja olet niinkuin muutkin ihmiset tai


lähdet.

Lampimäki on tarttunut renkiään käsipuolesta ja taluttaa häntä


ovea kohden, mutta Jaska riuhtaisee itsensä irti ja tulee tyrkänneeksi
isäntää rintaan. Lampimäki on nuoruudessaan ollut suuri tappelija,
nyt on hän uskovainen, mutta hänen sisunsa nousee, hän nostaa
Jaskan kohoksi ja kantaa hänet ovesta ulos.

Pihalle lentäessään Jaska raivostuu ja hän aikoo hyökätä sisään


hakemaan kivääriään, mutta tyrmistyy, kun huomaa, että se
suuressa kaaressa lentää hänen jälessään ja putoaa melkein jalkain
juureen. Eivät siis huolineet hänen aseestaankaan.

— Taisi tulla liian äkkinäinen teko, sanoi Suuriniemi.

— Meinasin ensin puhua sille järkeä ja vähältä piti, etten pyytänyt


anteeksi, kun kerran kuskasin sen navetan kokille… vastasi
Lampimäki. — Taisi silloin surusta ryypiskellä.

— Hyvä kun ei tullut tehdyksi, keskeytti toinen. Peloksi olisi


katsonut. Mutta kyllä nyt saa lähettää miehiä tännekin…

Lampimäki katui itsekin tekoaan. Hänen takiaan piti nyt hajoittaa


muutenkin pieni joukko. Suuriniemi meni puhelimen luo soittaakseen
Peltoniemeen, mutta keskuksessa olikin jo ryssä vastaamassa.

*****

Jaskan mielen täytti suunnaton raivo. Hänen ensi ajatuksensa,


kuten sanottu, oli hyökätä sisään, mutta kun kivääri lensi hänen
jalkainsa juureen, tunsi hän tulevansa jollakin tavoin nöyryytetyksi ja
asiasta lyödyksi ja raivontunne sai väistyä kylmän, harkitsevan
kostontunteen edestä. Viiteen taloon oli hyökättävä: Lampimäkeen,
Suuriniemeen, Peltoniemeen, seuran talolle ja Muiluun, ja hän
laittaisi itsensä siihen sakkiin, joka hyökkäisi Lampimäkeen. Mutta se
oli tapahtuva vasta ylihuomenna, kun Ristinjoelta tulisi enemmän
ryssiä avuksi. Jaska ei voinut tietää, että juuri samalla hetkellä
riisuttiin Ristinjoen ryssiä aseista ja annettiin niille selkään. Jaska sitä
ei tiennyt, mutta Lampimäessä, Peltoniemessä ja muissa porvarien
pesäpaikoissa se tiedettiin.

Ilta oli jo pimennyt, mutta maantiellä oli liike yhäkin tavallista


vilkkaampi. Sähkövalot paloivat kirkon tienristeyksessä ja Lampimäen
kujan suussa niinkuin tavallisesti, mutta ilmassa oli odotusta ja
hiukan niinkuin jotakin kiimaa. "Talo" ei sovi näkymään maantielle
niinkuin Lampimäen ikkunoihin, mutta sieltäpäin kuului huutoa,
melua ja naurua ja niistä eroittautuu selvästi pari laukausta. Jaska
hätkähtää: Jokohan ovat ruvenneet…? Mutta taitavat vain muuten
ammuskella talollisia peloittaakseen.
Jaska alkaa kiivaasti astella "talolle” päin. Linnuntietä sinne olisi
vain vajaa kilometri, mutta maantie mutkittelee niin, että matkaa
karttuu ainakin vanha virsta. Lampimäen laaja kotipelto ja Muilun
rakennusryhmä eroittavat toisistaan Jaskan palveluspaikan ja
»talon". Muilulainen on aikoinaan myynyt palstan "talolle"
sopuhinnasta, mutta taitaisipa ottaa pois, jos voisi. Niin ne ovat
vastakkain kuin kaksi linnoitettua leiriä, Muilu ja työnväentalo, ja
edellisen takana Lampimäki niinkuin jonkunlaisena reservinä.

Kaksi ryssää tulee Jaskaa vastaan maantiellä, huomaavat kiväärin


ja hämärästi nauhan käsivarressa, tulevat ääreen ja alkavat puhua
tolittaa.

Jaska kuuntelee aikansa ymmärtämättä sanaakaan.

— Menkää helvettiin! sanoo hän sitten jatkaen matkaansa.

Jaskalla ei ole alunpitäenkään ollut minkäänlaista myötätuntoa


venäläisiä kohtaan ja itsetietoisesti lukeutuu hän siihen luokkaan,
joiden tajuntaan ei käsite ryssä sisälly ihmisrotuna. Pikkupoikana on
hän kuullut, että hänen isoisänsä isä on ottanut osaa Alavuden
taisteluun, mutta hänen vastenmielisyytensä ryssiä kohtaan ei johdu
siitä. Mistä se johtuu, sitä hän ei rupea eikä pysty selvittämään.

Ryssien kohtaaminen vaikuttaa tyynnyttäväsi Jaskan mielialaan.


Hänen kostonhimonsa ikäänkuin tasoittuu ja saa leveät suuntaviivat.
Hän tulee taistelemaan ryssien puolella, eli ryssät hänen puolellaan,
aatteen vuoksi. Lampimäki sisältyy niihin, joita vastaan aate
taistelee. Lampimäki on porho, jolla on vuosittain parisataa
veroäyriä, ja hän, Jaska, kuuluu köyhälistöön,
sosiaalidemokraatteihin.
Itse asiassa on Jaskan suhde aatteeseenkin vähän heikontunut
senjälkeen kun Muilun neljäs piika tuli paksuksi. Oli sattunut niin,
että Muilun neljäs piika, Riika, oli Jaskan nimetty morsian. Ensin oli
kovisteltu Jaskaa, mutta sitten olikin käynyt selville, että se oli ryssä.
Senkin, kovistelemisen, oli suorittanut Lampimäen isäntä.

— Sano nyt vaan suoraan, äläkä kieräile, oli isäntä sanonut. Ei


täällä passaa ruveta lapsia kylälle tekemään. Jos se sinun on, niin
naitava sun on. Kylläpähän sitten saamme katsella, miten elämään
tulette.

— Ei se minun ole.

— Ei! No kenen sitten?

— Pirustako minä tiedän.

— Kuule: ei passaa kiroilla!

— Niin, mutta minun se ei voi olla.

Isäntä oli pannut lakin päähänsä ja mennyt suoraan Muiluun.

— Kyllä nyt Jaskan retkistä selvä otetaan, oli väki sanonut.

Iltamyöhällä oli isäntä palannut.

— Ryssälle kuuluu tulevan. Otimme Muilun kanssa selvän. Riika


itse tunnusti. Ja Muilu sanoi, että nyt on parasta, tyttö, että lähdet
kotimökillesi.

Seuraavana lauantaina oli Jaska juonut itsensä humalaan, ja isäntä


kuskannut hänet navetan ylisille kuin elukan.
*****

Kun Jaska nyt näin palauttaa mieleensä tapauksia, esiintyy


Lampimäki hänelle uudessa valaistuksessa. Tällä tavoin,
yhdistelemällä tapauksia. ei hän ennen ole tullut ajatelleeksi.

Muilun kohdalla Jaskan huomiota herättää se, että talosta ei näy


valontuikahdustakaan. Alkaa olla jo lypsyn aika, mutta navetta on
aivan pimeä. Suunnaton graniittirakennus piirtyy tummana
möhkäleenä taivasta vasten. Yksinäinen koira haukahtaa pihamaalla,
muuten on Muilussa kaikki kuolonhiljaista. Jaskaan se vaikuttaa
hiukan kammoa herättävästi. Pitää sanoa "talolla", että ovat
varuillaan. Sitä ei tiedä, mitä Muilusta tulee. Hän astuu
kymmenkunta askelta Muilun tuttua kujaa, mutta kääntyy takaisin.
Mitäpä hän sitä kujaa enää, vaikka matkaa "talolle" oikaisisikin.

Muilun pimeys on vaikuttanut "talollakin" painostavasti ja


innostusta poistavasti. On niinkuin Muilun pimeiden ikkunain
uutimien takaa katselisi kylmä ja hiukan ivallinen totuus. Jaska
huomaa, ettei hänen varoitustaan tarvita.

— Pitäisi mennä ottamaan selville, mitä siellä oikein on tekeillä,


sanoo Reenin Mikko, päällikkö.

— Mene itse, per…

Siellä, tien toisella puolen, sadan sylen päässä, toljottavat Muilun


neljätoista pimeää ikkunaa. Jokaisessa ikkunassa saattaa olla kivääri.
Mene sinne sitten haravoimaan.

Seinäkello lyö kahdeksaa.


Ryssät oljentelevat pitkin seiniä, puuhaavat, tolittavat ja
naureskelevat, joku soittelee hanuria, mutta ei koskaan pääse
kappaleen loppuun, kun jo aloittaa uutta. Naiset kantavat höyryäviä
ruoka-astioita keittiön puolelta näyttämölle, jossa aterioiminen
tapahtuu. Ketään talollisen palvelijaa ei näy joukossa, naiset ovat
kaikki sahalaisten vaimoja ja tyttäriä tai sitten muualta kulkeutuneita.

Työväenmarssi kajahtaa. Miesten epäsointuisat, järeät äänet


sekaantuvat naisten enemmän tai vähemmän kirkuviin sopraanoihin,
mutta ensi innostus on laskeutunut ja mieliala pysyy
auttamattomasti lamassa. Ilma on sakea ja lamput kiiluvat kuin
jostakin verkon takaa.

Jotkut ryssät pistävät pieneksi tanssiksi, laskevat ujostelematta ja


asiallisina kätensä naisten vyötäisille ja pyörähtävät näyttämön
edessä. Naiset ovat raukean ja autuaan näköisiä. Silloin Jaskan
ellottava tunne kasvaa ja hän tekee mielessään äkkinäisen
päätöksen: noiden kanssa ei millekään.

Jollakin tavoin tuntee hän itsensä orvoksi ja yksinäiseksi tässä


ympäristössä. Täällä ei ole ketään hänen parhaita tovereitaan, vain
itsetietoisia sahalaisia ja ylpeitä asemalaisia, jotka toisinaan luovat
hiukan ivallisia katseita renkiin. Renki, — renki ei ole luokkatietoinen
työläinen, renki on jotakin manttaalipösön ja työmiehen väliltä, joku
sellainen, johon ei luokkatietoinen voi oikein luottaa, sillä renki on
ympäristössään imenyt liiaksi manttaalihenkeä ja -katsantotapaa
itseensä.

Nyt Reenin Mikko nousee puhumaan.

— Toverit ja te, venäläiset veljemme, aloittaa hän. Taistelu on


alkanut, porvariston kahdestoista hetki on lyönyt ja turhaan hiovat
lahtarit aseitaan…

Jaska kuuntelee puhetta kuin läpi unen eikä monikaan sana ennä
hänen korviinsa. »Venäläiset veljemme” ‒ Riikan sulhaset ja muut.
Ja mitä ovat porvarit hänelle tehneet? Eihän häneltä ole mitään
puuttunut, talolliset ja heidän poikansa ovat kohdelleet häntä
yhdenvertaisena, häntä, niinkuin kaikkia muitakin. Eivät ole
läheskään niin ylpeitä kuin asemalaiset aatteensa kanssa. Lampimäki
oli kyllä kantanut niskasta hänet navetan kokille, mutta olihan se
kerran tyyrännyt nimismiehenkin portaita alas. Hän, Jaska, oli ollut
päissään niinkuin nimismieskin, samanveroisia, nimismies ja hän.
Sitten Lampimäki oli ruvennut katsomaan hänen etuaan siinä
Riikankin asiassa, luvannut, että kyllä te elämään tulette, jos vika on
Jaskassa. Mutta eipä ollut, — ryssässä oli vika. Kun Lampimäki nyt
illalla taas heitti hänet ovesta ulos, niin eiköhän siinäkin ollut
oikeutusta? Mennä nyt ase kädessä häristelemään toisen asuntoon
ja ruveta vaatimaan ruokaa, vaikka tietää, että vähän ajan kuluttua
rupeaa sotimaan ruuan antajaa vastaan.

Mitenkä hän, Jaska, oli tähän sakkiin oikein tullut? Ensi kerran oli
tullut Eilolan Toivon kanssa vähän hönässä ja sitten tullut toisenkin
kerran ja kolmannen. Niin se sitten oli käynyt.

Kun Jaska näitä aprikoitsi mielessään huomasi hän senkin, ettei


häntä millään tavalla kohdeltu täällä toverina, vaan oppipoikana, jota
pidettiin miesten joukossa niinkuin puolittain armosta. Ja sitten nuo
ryssät, nuo iankaikkisen vaivatut "venäläiset veljet", jotka tunkivat
joka paikkaan niinkuin syöpäläiset ja joiden veljellisistä töistä oli
lehdissä saatu lukea koko viime syksy ja kulunut talvi.

Ei, totisesti. Ryssien sakkiin hän ei halunnut kuulua, vaan


pikemminkin siihen, joka antoi heitä selkään. Se on sittenkin paljon
reilumpaa.

— Sitäkö ne noista ryssistä venyttävät perässään, sanoo hän


ajatuksissaan vierustoverilleen.

— Sitä minäkin, vastaa toveri, Eilolan Iivari. Kun olisi kaveri, niin
pois lähtisin.

Jaska tajuaa syvästi, että jos hän nyt jättää kiväärinsä oven
pieleen ja menee tiehensä, ei häntä kukaan tule kaipaamaan. Hän
on vain talollisen renki niinkuin Eilolan Toivo ja Iivarikin, eivätkä
sellaiset ole luokkatietoisia työläisiä.

— Lähdetään hiivattiin ryssien joukosta, sanoo hän hetken


kuluttua.

Kukaan ei estä heidän lähtöään. Reenin Mikko pitää vielä puhetta


ja pihalla käy kihinä ja kuhina. Siellä on Riikakin maha pystyssä.

— Mitä sinä täältä haet? kysäisee Jaska ohimennessään.

— Muuten vaan… inisee Riika.

Taas Jaskaan nousee suuri, raivostuttava vihantunne ja hän


tarttuu tyttöä kiivaasti käsivarteen.

— Kyllä se, perkele vie, on parasta, että marssit kotiin takaisin,


sillä kyllä nyt tulee iivanoitten viimeinen päivä, sanoo hän raa'asti.

Nainen vikisee ja Eilolan Iivari sanoo:

— Älähän nyt tuolla tavalla.


Mutta Riikaan on mennyt turvallisuudentunteen tapainen, hän
itkee, mutta kävelee nöyrästi ja hiukan peljäten Jaskan edellä ja kun
maantielle päästään, ohjaa hän kulkunsa Sydänmaalle päin, missä
hänen kotinsa on.

— Entä minne sinä menet? kysyy Iivari Jaskalta.

— Sinne, minne muutkin miehet, vastaa Jaska ynseästi ja kääntää


kulkunsa Peltoniemeen.

— Ota edes tuo nauha käsivarrestasi.

Sanaa puhumatta irroittaa Jaska nauhan ja pistää sen taskuunsa.

— Tuletko sinä mukaan? kysyy hän sitten Iivarilta.

— … tiedä, tuota, niin vaihtaa kuin liiviä, vastaa Iivari empien.


Taidan mennä kotiin nukkumaan.

Mutta Jaska painuu Peltonientä kohden.

*****

Yö meni rauhallisesti, niinkuin oli laskettukin. Ainoastaan


muutamia laukauksia vaihdettiin ja kaksi ryssää pääsi hengestään.
Kahden tunnin kuluttua oli kaikki selvää.

Aamulla katseli Lampimäki Jaskaa salatulla hartaudella. Olihan


siinä pohjalla sittenkin sitä oikeaa, niinkuin hän oli arvellutkin. Mutta
mitään hän ei sanonut.

Illalla tulee Jaska tupakamariin ja sanoo isännälle, että pitäisi


saada vähän rahaa.
— Mitä sinä sillä? kysyy isäntä.

— Tulisi vähän menoa.

— Minne sitten?

— No sinne Vilppulaan, vastaa Jaska äkäisesti ja ikäänkuin


ihmetellen, ettei toinen ensi sanomalla ymmärrä.

Lampimäki on itseensä sulkeutunut, ulkonaisesti tyly mies ja


häneltä jää Jaskan käsi puristamatta. Sensijaan hän nopeasti
kääntyy ympäri ja menee laatikolleen, ettei toinen huomaisi hellää
välähdystä hänen silmissään.

— Mikäpäs siinä, myönsi hän. Jos se aatteellesi sopii, niin mene


vaan. Siellä saat ainakin tapella kylliksesi poliisin tulematta väliin
niinkuin kylällä kuuluu tapahtuneen.
*** END OF THE PROJECT GUTENBERG EBOOK POHJALAISIA JA
PERÄPOHJALAISIA ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like