100% found this document useful (2 votes)
41 views

[FREE PDF sample] Mastering Large Datasets with Python Parallelize and Distribute Your Python Code 1st Edition John T Wolohan ebooks

Parallelize

Uploaded by

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

[FREE PDF sample] Mastering Large Datasets with Python Parallelize and Distribute Your Python Code 1st Edition John T Wolohan ebooks

Parallelize

Uploaded by

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

Download the full version of the textbook now at textbookfull.

com

Mastering Large Datasets with Python


Parallelize and Distribute Your Python Code
1st Edition John T Wolohan

https://textbookfull.com/product/mastering-large-
datasets-with-python-parallelize-and-distribute-
your-python-code-1st-edition-john-t-wolohan/

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


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

Begin to Code with Python Rob Miles

https://textbookfull.com/product/begin-to-code-with-python-rob-miles/

textbookfull.com

Supercharged Python Take Your Code to the Next Level Brian


Overland

https://textbookfull.com/product/supercharged-python-take-your-code-
to-the-next-level-brian-overland/

textbookfull.com

Mastering Python forensics : master the art of digital


forensics and analysis with Python First Published October
2015 Edition Uhrmann
https://textbookfull.com/product/mastering-python-forensics-master-
the-art-of-digital-forensics-and-analysis-with-python-first-published-
october-2015-edition-uhrmann/
textbookfull.com

Adaptive Behavior and Learning 2nd Edition J. E. R.


Staddon

https://textbookfull.com/product/adaptive-behavior-and-learning-2nd-
edition-j-e-r-staddon/

textbookfull.com
Best tent camping Northern California your car camping
guide to scenic beauty the sounds of nature and an escape
from civilization Fifth Edition Speicher
https://textbookfull.com/product/best-tent-camping-northern-
california-your-car-camping-guide-to-scenic-beauty-the-sounds-of-
nature-and-an-escape-from-civilization-fifth-edition-speicher/
textbookfull.com

Theory and Experiment in Gravitational Physics Clifford M.


Will

https://textbookfull.com/product/theory-and-experiment-in-
gravitational-physics-clifford-m-will/

textbookfull.com

A Course for Teaching English Learners, 3rd Edition Diaz-


Rico

https://textbookfull.com/product/a-course-for-teaching-english-
learners-3rd-edition-diaz-rico/

textbookfull.com

Taming the Big Green Elephant Setting in Motion the


Transformation Towards Sustainability Ariel Macaspac
Hernández
https://textbookfull.com/product/taming-the-big-green-elephant-
setting-in-motion-the-transformation-towards-sustainability-ariel-
macaspac-hernandez/
textbookfull.com

Tim Maia s Tim Maia racional vols 1 2 First Edition Thayer

https://textbookfull.com/product/tim-maia-s-tim-maia-racional-
vols-1-2-first-edition-thayer/

textbookfull.com
Theory and Applications of Heat Transfer in Humans 1st
Edition Devashish Shrivastava

https://textbookfull.com/product/theory-and-applications-of-heat-
transfer-in-humans-1st-edition-devashish-shrivastava/

textbookfull.com
Mastering Large Datasets with
Python: Parallelize and
Distribute Your Python Code
John T. Wolohan
Copyright
For online information and ordering of this and other Manning books,
please visit www.manning.com. The publisher offers discounts on
this book when ordered in quantity. For more information, please
contact

Special Sales Department

Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Email: [email protected]

©2019 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval


system, or transmitted, in any form or by means electronic,
mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in the book, and Manning Publications was
aware of a trademark claim, the designations have been printed in
initial caps or all caps.

Recognizing the importance of preserving what has been written,


it is Manning’s policy to have the books we publish printed on acid-
free paper, and we exert our best efforts to that end. Recognizing
also our responsibility to conserve the resources of our planet,
Manning books are printed on paper that is at least 15 percent
recycled and processed without the use of elemental chlorine.
Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Development editor: Marina Michaels

Technical development editor: Michael Smolyak

Review editor: Aleksandar Dragosavljević

Production editor: Deirdre Hiam

Copy editor: Carl Quesnel

Proofreader: Keri Hales

Technical proofreader: Al Krinker

Typesetter: Dennis Dalinnik

Cover designer: Marija Tudor

ISBN: 9781617296239

Printed in the United States of America


Brief Table of Contents
Copyright
Brief Table of Contents
Table of Contents
Preface
Acknowledgments
About this book
About the author
About the cover illustration

1.
Chapter 1. Introduction
Chapter 2. Accelerating large dataset work: Map and parallel
computing
Chapter 3. Function pipelines for mapping complex
transformations
Chapter 4. Processing large datasets with lazy workflows
Chapter 5. Accumulation operations with reduce
Chapter 6. Speeding up map and reduce with advanced
parallelization

2.
Chapter 7. Processing truly big datasets with Hadoop and Spark
Chapter 8. Best practices for large data with Apache Streaming
and mrjob
Chapter 9. PageRank with map and reduce in PySpark
Chapter 10. Faster decision-making with machine learning and
PySpark

3.
Chapter 11. Large datasets in the cloud with Amazon Web
Services and S3
Chapter 12. MapReduce in the cloud with Amazon’s Elastic
MapReduce

Index

List of Figures

List of Tables

List of Listings
Table of Contents
Copyright
Brief Table of Contents
Table of Contents
Preface
Acknowledgments
About this book
About the author
About the cover illustration

1.
Chapter 1. Introduction
1.1. What you’ll learn in this book
1.2. Why large datasets?
1.3. What is parallel computing?
1.3.1. Understanding parallel computing
1.3.2. Scalable computing with the map and reduce style
1.3.3. When to program in a map and reduce style

1.4. The map and reduce style


1.4.1. The map function for transforming data
1.4.2. The reduce function for advanced transformations
1.4.3. Map and reduce for data transformation pipelines

1.5. Distributed computing for speed and scale


1.6. Hadoop: A distributed framework for map and reduce
1.7. Spark for high-powered map, reduce, and more
1.8. AWS Elastic MapReduce—Large datasets in the cloud
Summary
Chapter 2. Accelerating large dataset work: Map and parallel
computing
2.1. An introduction to map
2.1.1. Retrieving URLs with map
2.1.2. The power of lazy functions (like map) for large datasets

2.2. Parallel processing


2.2.1. Processors and processing
2.2.2. Parallelization and pickling
2.2.3. Order and parallelization
2.2.4. State and parallelization

2.3. Putting it all together: Scraping a Wikipedia network


2.3.1. Visualizing our graph
2.3.2. Returning to map

2.4. Exercises
2.4.1. Problems of parallelization
2.4.2. Map function
2.4.3. Parallelization and speed
2.4.4. Pickling storage
2.4.5. Web scraping data
2.4.6. Heterogenous map transformations

Summary

Chapter 3. Function pipelines for mapping complex


transformations
3.1. Helper functions and function chains
3.2. Unmasking hacker communications
3.2.1. Creating helper functions
3.2.2. Creating a pipeline
3.3. Twitter demographic projections
3.3.1. Tweet-level pipeline
3.3.2. User-level pipeline
3.3.3. Applying the pipeline

3.4. Exercises
3.4.1. Helper functions and function pipelines
3.4.2. Math teacher trick
3.4.3. Caesar’s cipher

Summary

Chapter 4. Processing large datasets with lazy workflows


4.1. What is laziness?
4.2. Some lazy functions to know
4.2.1. Shrinking sequences with the filter function
4.2.2. Combining sequences with zip
4.2.3. Lazy file searching with iglob

4.3. Understanding iterators: The magic behind lazy Python


4.3.1. The backbone of lazy Python: Iterators
4.3.2. Generators: Functions for creating data

4.4. The poetry puzzle: Lazily processing a large dataset


4.4.1. Generating data for this example
4.4.2. Reading poems in with iglob
4.4.3. A poem-cleaning regular expression class
4.4.4. Calculating the ratio of articles

4.5. Lazy simulations: Simulating fishing villages


4.5.1. Creating a village class
4.5.2. Designing the simulation class for our fishing simulation
4.6. Exercises
4.6.1. Lazy functions
4.6.2. Fizz buzz generator
4.6.3. Repeat access
4.6.4. Parallel simulations
4.6.5. Scrabble words

Summary

Chapter 5. Accumulation operations with reduce


5.1. N-to-X with reduce
5.2. The three parts of reduce
5.2.1. Accumulation functions in reduce
5.2.2. Concise accumulations using lambda functions
5.2.3. Initializers for complex start behavior in reduce

5.3. Reductions you’re familiar with


5.3.1. Creating a filter with reduce
5.3.2. Creating frequencies with reduce

5.4. Using map and reduce together


5.5. Analyzing car trends with reduce
5.5.1. Using map to clean our car data
5.5.2. Using reduce for sums and counts
5.5.3. Applying the map and reduce pattern to cars data

5.6. Speeding up map and reduce


5.7. Exercises
5.7.1. Situations to use reduce
5.7.2. Lambda functions
5.7.3. Largest numbers
5.7.4. Group words by length
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Summary

Chapter 6. Speeding up map and reduce with advanced


parallelization
6.1. Getting the most out of parallel map
6.1.1. Chunk sizes and getting the most out of parallel map
6.1.2. Parallel map runtime with variable sequence and chunk
size
6.1.3. More parallel maps: .imap and starmap

6.2. Solving the parallel map and reduce paradox


6.2.1. Parallel reduce for faster reductions
6.2.2. Combination functions and the parallel reduce workflow
6.2.3. Implementing parallel summation, filter, and frequencies
with fold

Summary

2.
Chapter 7. Processing truly big datasets with Hadoop and Spark
7.1. Distributed computing
7.2. Hadoop for batch processing
7.2.1. Getting to know the five Hadoop modules

7.3. Using Hadoop to find high-scoring words


7.3.1. MapReduce jobs using Python and Hadoop Streaming
7.3.2. Scoring words using Hadoop Streaming

7.4. Spark for interactive workflows


7.4.1. Big datasets in memory with Spark
7.4.2. PySpark for mixing Python and Spark
7.4.3. Enterprise data analytics using Spark SQL
7.4.4. Columns of data with Spark DataFrame

7.5. Document word scores in Spark


7.5.1. Setting up Spark
7.5.2. MapReduce Spark jobs with spark-submit

7.6. Exercises
7.6.1. Hadoop streaming scripts
7.6.2. Spark interface
7.6.3. RDDs
7.6.4. Passing data between steps

Summary

Chapter 8. Best practices for large data with Apache Streaming


and mrjob
8.1. Unstructured data: Logs and documents
8.2. Tennis analytics with Hadoop
8.2.1. A mapper for reading match data
8.2.2. Reducer for calculating tennis player ratings

8.3. mrjob for Pythonic Hadoop streaming


8.3.1. The Pythonic structure of a mrjob job
8.3.2. Counting errors with mrjob

8.4. Tennis match analysis with mrjob


8.4.1. Counting Serena’s dominance by court type
8.4.2. Sibling rivalry for the ages

8.5. Exercises
8.5.1. Hadoop data formats
8.5.2. More Hadoop data formats
8.5.3. Hadoop’s native tongue
8.5.4. Designing common patterns in MRJob

Summary

Chapter 9. PageRank with map and reduce in PySpark


9.1. A closer look at PySpark
9.1.1. Map-like methods in PySpark
9.1.2. Reduce-like methods in PySpark
9.1.3. Convenience methods in PySpark

9.2. Tennis rankings with Elo and PageRank in PySpark


9.2.1. Revisiting Elo ratings with PySpark
9.2.2. Introducing the PageRank algorithm
9.2.3. Ranking tennis players with PageRank

9.3. Exercises
9.3.1. sumByKey
9.3.2. sumByKey with toolz
9.3.3. Spark and toolz
9.3.4. Wikipedia PageRank

Summary

Chapter 10. Faster decision-making with machine learning and


PySpark
10.1. What is machine learning?
10.1.1. Machine learning as self-adjusting judgmental
algorithms
10.1.2. Common applications of machine learning

10.2. Machine learning basics with decision tree classifiers


10.2.1. Designing decision tree classifiers
10.2.2. Implementing a decision tree in PySpark
10.3. Fast random forest classifications in PySpark
10.3.1. Understanding random forest classifiers
10.3.2. Implementing a random forest classifier

Summary

3.
Chapter 11. Large datasets in the cloud with Amazon Web
Services and S3
11.1. AWS Simple Storage Service—A solution for large datasets
11.1.1. Limitless storage with S3
11.1.2. Cloud-based storage for scalability
11.1.3. Objects for convenient heterogenous storage
11.1.4. Managed service for conveniently managing large
datasets
11.1.5. Life cycle policies for managing large datasets over time

11.2. Storing data in the cloud with S3


11.2.1. Storing data with S3 through the browser
11.2.2. Programmatic access to S3 with Python and boto

11.3. Exercises
11.3.1. S3 Storage classes
11.3.2. S3 storage region
11.3.3. Object storage

Summary

Chapter 12. MapReduce in the cloud with Amazon’s Elastic


MapReduce
12.1. Running Hadoop on EMR with mrjob
12.1.1. Convenient cloud clusters with EMR
12.1.2. Starting EMR clusters with mrjob
12.1.3. The AWS EMR browser interface

12.2. Machine learning in the cloud with Spark on EMR


12.2.1. Writing our machine learning model
12.2.2. Setting up an EMR cluster for Spark
12.2.3. Running PySpark jobs from our cluster

12.3. Exercises
12.3.1. R-series cluster
12.3.2. Back-to-back Hadoop jobs
12.3.3. Instance types

Summary

Index

List of Figures

List of Tables

List of Listings
Preface
The idea for this book came to me in the summer of 2018 after
working with some especially talented developers who had managed
to go a significant portion of their careers without learning how to
write scalable code. I realized then that a lot of the techniques for
“big data” work, or what we’ll refer to in this book as “large dataset”
problems, are reserved for those who want to tackle these problems
exclusively. Because a lot of these problems occur in enterprise
environments, where the mechanisms to produce data at this scale
are ripe, books about this topic tend to be written in the same
enterprise languages as the tools, such as Java.

This book is a little different. I’ve noticed that large dataset problems
are increasingly being tackled in a distributed manner. Not
distributed in the terms of distributed computing—though certainly
that as well—but distributed in terms of who’s doing the work.
Individual developers or small development teams, often working in
rapid prototyping environments or with rapid development languages
(such as Python), are now working with large datasets.

My hope is that this book can bring the techniques for scalable and
distributed programming to a broader audience of developers. We’re
living in an era where big data is becoming increasingly prevalent.
Skills in parallelization and distributed programming are increasingly
vital to developers’ day-to-day work. More and more programmers
are facing problems resulting from datasets that are too large for the
way they’ve been taught to think about them. Hopefully, with this
book, developers will have the tools to solve those big data problems
and focus on the ones that got them interested in programming in
the first place.
Acknowledgments
A special thanks to all the developers of and contributors to the
excellent tools I’ve covered in this book, as well as all the wonderful
folks at Manning who helped make this book possible: Stephen
Soehnlen, Marina Michaels, Aleksandar Dragosavljevic, Deirdre Hiam,
Carl Quesnel, Keri Hales, and Barbara Mirecki. Also thank you to my
technical proofer, Al Krinker, and technical developmental editor,
Michael Smolyak.

To all the reviewers: Aditya Kasuhik, Al Krinker, Ariel Gamino, Craig


E. Pfeifer, David Jacobs, Diego Casella, Duncan McRae, Gary Bake,
Hawley Waldman, Jason Rendel, Jibesh Patra, Joseph Wang, Justin
Fister, Maxim Kupfer, Richard Meinsen, Richard Tobias, Sayak Paul,
Simone Sguazza, Stuart Woodward, Taylor Dolezal, and Vitosh K.
Doynov, your suggestions helped make this a better book.
About this book
Who should read this book
The goal of this book is to teach a scalable style of programming. To
do that, we’ll cover a wider range of material than you might be
familiar with from other programming or technology books. Where
other books might cover a single library, this book covers many
libraries—both built-in modules, such as functools and itertools, as
well as third-party libraries, such as toolz, pathos, and mrjob. Where
other books cover just one technology, this book covers many,
including Hadoop, Spark, and Amazon Web Services (AWS). The
choice to cover a broad range of technologies is admitting the fact
that to scale your code, you need to be able to adapt to new
situations. Across all the technologies, however, I emphasize a “map
and reduce” style of programming in Python.

You’ll find that this style is a constant throughout the changing


environment in which your code is running, which is why I adopted it
in the first place. You can use it to rapidly adapt your code to new
situations. Ultimately, the book aims to teach you how to scale your
code by authoring it in a map and reduce style. Along the way, I also
aim to teach you the tools of the trade for big data work, such as
Spark, Hadoop, and AWS.

I wrote this book for a developer or data scientist who knows


enough to have gotten themselves into a situation where they’re
facing a problem caused by having too much data. If you know how
to solve your problem, but you can’t solve it fast enough at the scale
of data with which you’re working, this book is for you. If you’re
curious about Hadoop and Spark, this book is for you. If you’re
looking for a few pointers on how to bring your large data work into
the cloud, this book could be for you.
How this book is organized: A roadmap
In chapter 1, I introduce the map and reduce style of programming
and what I’ll cover in this book. I discuss the benefits of parallel
programming, the basics of distributed computing, the tools we’ll
cover for parallel and distributed computing, and cloud computing. I
also provide a conceptual model for the material that I cover in this
book.

In chapter 2, I introduce the map part of the map and reduce style,
and we look at how to parallelize a problem to solve it faster. I cover
the process of pickling in Python—how Python shares data during
parallelization—and we’ll tackle an example using parallelization to
speed up web scraping.

In chapter 3, we’ll use the map function to perform complex data


transformations. In this chapter, I teach how you can chain small
functions together into function pipelines or function chains to great
effect. I also show how you can parallelize these function chains for
faster problem solving on large datasets.

In chapter 4, I introduce the idea of laziness and how you can


incorporate laziness to speed up your large data workflows. I show
how lazy functions allow you to tackle large dataset problems locally,
how you can create your own lazy functions, and how to best
combine lazy and hasty approaches to programming. We’ll use these
lazy methods to solve a simulation problem.

In chapter 5, I cover accumulation transformations with the reduce


function. I also teach the use of anonymous or lambda functions. In
this chapter, we’ll use the reduce function to calculate summary
statistics on a large dataset.

In chapter 6, I cover advanced parallelization techniques using both


map and reduce. You’ll learn advanced functions for parallelization in
Python, as well as how and when to pursue a parallel solution to
your problem. In this chapter, you’ll also learn how to implement
parallel reduce workflows.

In chapter 7, I introduce the basics of distributed computing as well


as the technologies of Hadoop and Spark. You’ll write introductory
programs in Hadoop and Spark, and learn the benefits of each
framework. We’ll also cover the situations in which Hadoop is
preferable over Spark, and when Spark is preferable over Hadoop.

In chapter 8, I cover how to use Hadoop streaming to run your map-


and-reduce–style code on a distributed cluster. I also introduce the
mrjob library for writing Hadoop jobs in Python. We’ll cover how to
move complex data types between Hadoop job steps. We’ll cement
these principles with hands-on examples analyzing web traffic data
and tennis match logs.

In chapter 9, we dive into using Spark for distributing our Python


code. I cover Spark’s RDD data structure as well as convenience
methods of the RDD that you can use to implement your code in a
map and reduce style. We’ll also implement the classic PageRank
algorithm on the tennis match log data from chapter 8.

In chapter 10, we look at one of the most popular applications of


Spark: parallel machine learning. In this chapter, we cover some of
the basics of machine learning. We’ll practice these principles by
implementing decision trees and forests to predict whether
mushrooms are poisonous or not.

In chapter 11, I cover the basics of cloud computing and the nature
of cloud storage. We’ll put our learning into practice by loading data
into Amazon S3 using both the web GUI and the boto3 AWS API
wrapper library for Python.

In chapter 12, we use Amazon ElasticMapReduce to run distributed


Hadoop and Spark jobs in the cloud. You’ll learn how to set up an
elastic Hadoop cluster from the console using mrjob and from the
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
AWS browser-based GUI. Once you’ve mastered this chapter, you’ll
be ready to tackle datasets of any size.

About the code


On the journey to mastering large datasets with Python, you’ll need
a few tools, the first of which is a recent version of Python.
Throughout this book, any version of Python 3.3+ will work. For the
most part, you can install the remainder of the software you’ll need
with a single pip command:

pip install toolz pathos pyspark mrjob --user

If you’d like to set up a virtual environment to keep the packages


installed with this book separate from Python packages you currently
have installed on your path, you can do this with a few lines of code
as well:

$ python3 -m venv mastering_large_datasets

$ pip install toolz pathos pyspark mrjob --user

$ source mastering_large_datasets/bin/active

If you set up a virtual environment, remember that you’ll need to


run the source command to activate it so you can access the
libraries inside of it.

Beyond Python, the only software that you’ll need for this book is
Hadoop. The easiest way to install Hadoop is to go to the Hadoop
website and follow the instructions for downloading Hadoop there:
https://hadoop.apache.org/releases.html. Hadoop is written in Java,
so you’ll also need to have a Java Development Kit installed to run it.
I recommend OpenJDK. You can download OpenJDK from the
OpenJDK website: https://openjdk.java.net/.

Finally, to complete the last two chapters of the book, you’ll need an
AWS account. You can create a new AWS account by going to
https://aws.amazon.com, selecting “Sign in to the Console,” and
then creating a new AWS account. To set up your account, you’ll
need to provide a payment method. Amazon will use this method to
charge you for resources you use. For this book, you won’t need
more than $5 of resources from AWS. To ensure you don’t spend
more than you’re comfortable with, you can get a prepaid Visa card
and set that up as your payment method. You can find prepaid Visa
cards at stores like CVS, Walgreens, Rite-Aid, Target, and Walmart,
as well as many convenience stores and gas stations. You won’t
need an AWS account until chapter 11.

liveBook discussion forum


Purchase of Mastering Large Datasets with Python includes free
access to a private web forum run by Manning Publications where
you can make comments about the book, ask technical questions,
and receive help from the author and from other users. To access
the forum, go to https://livebook.manning.com/book/mastering-
large-datasets/welcome/v-5/discussion. You can also learn more
about Manning’s forums and the rules of conduct at
https://livebook.manning.com/#!/discussion.

Manning’s commitment to our readers is to provide a venue where a


meaningful dialogue between individual readers and between
readers and the author can take place. It is not a commitment to
any specific amount of participation on the part of the author, whose
contribution to the forum remains voluntary (and unpaid). We
suggest you try asking the author some challenging questions, lest
his interest stray! The forum and the archives of previous
discussions will be accessible from the publisher’s website as long as
the book is in print.
About the author

J.T. Wolohan is a senior artificial intelligence and natural language


processing architect at Booz Allen Hamilton. He has taught
programming to learners of all levels: from elementary and middle
school students up to graduate students and professionals. In
addition to his interests in distributed and parallel computing, J.T.
enjoys running, cooking, and spending time with his family.
About the cover illustration
The figure on the cover of Mastering Large Datasets with Python is
captioned “Costumes civils actuels de tous les peuples connus,” or
“Current Civilian Costumes of All Known Peoples.” The illustration is
taken from a collection of dress costumes from various countries by
Jacques Grasset de Saint-Sauveur (1757–1810), titled Costumes de
Différents Pays, published in France in 1797. Each illustration is finely
drawn and colored by hand. The rich variety of Grasset de Saint-
Sauveur’s collection reminds us vividly of how culturally apart the
world’s towns and regions were just 200 years ago. Isolated from
each other, people spoke different dialects and languages. In the
streets or in the countryside, it was easy to identify where they lived
and what their trade or station in life was just by their dress.

The way we dress has changed since then and the diversity by
region, so rich at the time, has faded away. It is now hard to tell
apart the inhabitants of different continents, let alone different
towns, regions, or countries. Perhaps we have traded cultural
diversity for a more varied personal life—certainly for a more varied
and fast-paced technological life.

At a time when it is hard to tell one computer book from another,


Manning celebrates the inventiveness and initiative of the computer
business with book covers based on the rich diversity of regional life
of two centuries ago, brought back to life by Grasset de Saint-
Sauveur’s pictures.
Part 1.
Part 1 explores the map and reduce style of computing. We’ll
introduce map and reduce, as well as the helper and convenience
functions that you’ll need to get the most out of this style. In this
section, we’ll also cover the basics of parallel computing. The tools
and techniques in this part are useful for large data in categories 1
and 2: tasks that are both storable and computable locally, and tasks
that are not storable locally but are still computable locally.
Random documents with unrelated
content Scribd suggests to you:
Fig. 9.—The usual position of the
baby just before he is born.

The average normally developed baby has grown to a length of


about 20 inches and weighs about 7¼ pounds, boys usually being
about three ounces heavier than girls, but there may be a variation of
weight among entirely normal, healthy babies from a minimum of 5
pounds to as high as 11 pounds or more. Newborn babies very
seldom weigh more than 12 pounds, in spite of legends and rumors
to the contrary.
The size of the baby is affected by the race of his parents; colored
babies, for example, averaging a smaller weight than white babies.
And, as might be expected, the size of the parents is likely to be
reflected in their infants, large parents tending to have large children
and vice versa.
The number of children which the mother has previously borne is
also a factor, since the first child is usually the smallest, the size of
those following showing an increase with the mother’s age up to her
twenty-eighth year, if her pregnancies do not occur at too frequent
intervals.
Twins. Sometimes a woman gives birth to more than one baby at
the same time. When there are two they are called twins; triplets
when there are three; quadruplets, quintuplets and sextuplets
respectively, when there are four, five and six babies within the
uterus at once. Six is the largest accredited number on record.
It is estimated that twins occur once in ninety pregnancies and
triplets once in about seven thousand cases. The tendency seems to
be inherited, as is evidenced by the number of twins and triplets to
be found among relatives.
Twins are often prematurely born and each is likely to be smaller
than a baby resulting from a single pregnancy, but their combined
weight is greater than the weight of one normal baby.
Extra-uterine Pregnancy. Another departure from the normal
pregnancy is when the baby develops outside of the uterus. Although
in the normal course of events the fertilized ovum travels down the
tube and becomes attached to the uterine lining, it is possible for it to
stop, and more or less completely develop at any point along the way.
This is called an extra-uterine pregnancy, since it occurs outside of
the uterus. If the baby develops in one of the ovaries, it is termed an
ovarian pregnancy, and a tubal pregnancy if it develops in a tube,
this being the most frequent variety of extra-uterine pregnancies.
Only about one out of a hundred such pregnancies continue
throughout the allotted period, and accordingly, a live baby, capable
of living for any length of time, seldom results.
To sum up a normal pregnancy, we find that in the course of ten
lunar months following the fertilization of an ovum, the uterus grows
from a small, flattened pelvic organ, 3 inches in length, to a large
muscular sac, about 15 inches long occupying the abdominal cavity.
It increases its weight sixteen times, that is, from 2 ounces to 2
pounds, while the capacity of the uterine cavity is multiplied five
hundred times. Within the uterus is a baby weighing about 7¼
pounds; a placenta weighing perhaps 1¼ pounds and approximately
a quart of fluid. The baby is attached to the placenta by means of a
jelly-like cord about as thick as one’s first finger and 20 inches long;
baby, placenta, cord and fluid all being contained in a thin, but
strong sac frequently called the bag of waters, but by the doctors
termed the membranes. The total weight of the uterus and its
contents at the end of pregnancy is usually about 15 pounds.
Throughout the baby’s life within the uterus, the placenta virtually
acts as his digestive organs, lungs, kidneys and bowels. Bear this in
mind, and you will realize why, in taking care of yourself you are
taking care of your baby while his body is being built and getting
itself into running order to take up life as a separate being. The full
realization that whatever is good for you is good for your baby will
make you eager to give yourself the care that is outlined in the next
chapter.
CHAPTER V
TAKING CARE OF THE BABY BEFORE HE
COMES

We shall see that taking care of your baby before he is born means
taking such care of yourself throughout pregnancy, that you not only
keep your own body in its usual good running order, but in addition,
so effectively promote the activities of your various organs that you
also keep the baby’s body going, his body that is growing all the time.
Quite reasonably this requires extra work on the part of some of
your organs, particularly those concerned with digestion and the
process of throwing off impurities. The latter is of the greatest
possible importance for in addition to excreting the usual amount of
impurities from your own body you must excrete also those thrown
off by your baby. The amount of waste from him is not large but it
seems to be of such a character that it harms the mother if it is not
steadily excreted.
Good digestion and satisfactory excretion are dependent upon a
number of factors and fortunately most of them are within your own
control.
Your frame of mind is one of the most important factors of all. I
know that to suggest the cultivation of a cheerful, hopeful mental
attitude is easier said than done. But after all it really is largely a
matter of habit which you can acquire if you set yourself to it,
particularly if you realize that your physical condition will be
benefited by your going through pregnancy happily. And remember
that whatever is good for you is good for your baby.
Continue with the work, amusements and exercise that you are
used to and enjoy, except of course such activities as the doctor may
forbid. In general, try to forget that you are pregnant, so far as you
can do this and still remember to take proper care of yourself.
Above all, don’t worry. Worry will interfere with your sleep and it
will also upset your digestion quite as seriously as will wrong food.
Try not to be too self-centered or too watchful of your symptoms, but
at the same time avoid the dangerous habit of thinking that any
unusual condition which develops is due to your being pregnant, for
a sick pregnancy is not normal.
It will relieve you of a great deal of anxiety if you report to your
doctor everything you do not understand, for the consciousness that
he will know just what to do, if anything is necessary, will help to
keep you from worrying.
It is important, too, for you to get rid of the depressing beliefs in
connection with pregnancy that have come down to us through the
ages.
For instance, do not believe for a moment that anything you do,
think or see can “mark” or deform your baby, for remember that
after conception you give him nothing but nourishment. The only
communication between you and the baby is through your and his
blood, and blood does not carry mental impressions. Accordingly, no
effects of fear, horror or unpleasant memories which you may have
can possibly reach him. It is true that once in a while a woman does
see something shocking and later gives birth to a marked or
deformed baby. But there is little doubt, now, that such an
occurrence is merely a coincidence. If you will stop and think for a
moment you will realize that most expectant mothers see or hear or
think something unpleasant at some time during pregnancy, and yet
most babies are born without mark or blemish. Anger, fright or
sudden shock may upset your digestion, but it does not directly affect
your baby.
As for that common belief that in “reaching up” the mother may
slip the cord around the baby’s neck—if you will picture for a
moment how the baby lies within the uterus you will realize how
impossible this is, for the mother’s arms have no connection with
him or the cord.
So dismiss these doubts and fears from your mind and dwell
instead upon the loveliness of what is in store for you, for, I repeat,
your physical condition will be benefited if you go through pregnancy
happily. And remember again that whatever is good for you is good
for your baby.
So your first step toward caring for the little life already within
your charge is to follow the example of Mrs. Wiggs, who constantly
wiped the dust from her rose-colored spectacles.
Now for the more specific details of your care. Of these the
question of your diet is of enormous importance.
Let us consider first what your food accomplishes if it is suitable
and conditions are favorable for its use by you and the baby. It
should provide nourishment for your various tissues, as under
ordinary conditions; it should promote the activities of your skin and
kidneys, as well as bowels, since it is through them that the waste
from your own and your baby’s body must be excreted, and your food
should be adequate also, to build and nourish the baby’s body
without his having to draw materials from your tissues. Strange as it
may seem, the baby’s physical needs are supplied before yours are
met, and if there are not enough food materials for you both, your
bones, teeth and muscles will be deprived. Furthermore, taking
proper food during pregnancy is an important step toward preparing
yourself to nurse your baby, after he is born, which is quite as urgent
as nourishing him before birth.
To accomplish these ends you not only must eat suitable food, but
you must digest and absorb it as well. This requires that you
constantly guard against overeating, constipation and indigestion of
any kind. Indigestion may be avoided during pregnancy exactly as it
is at other times, by eating proper food, by cultivating a happy frame
of mind; by having sufficient exercise, fresh air, rest and sleep.
If you are accustomed to a fairly simple, well balanced, mixed diet,
you probably will need to make little or no change, except to have the
evening meal light if it has been a hearty one. It may surprise you to
learn that you need not “eat for two,” in quantity, as is so commonly
believed necessary, for during pregnancy you make so much better
use of food materials than usual that an amount and kind of food
that keep you in good condition will be adequate to meet your baby’s
needs, too, until the latter part of pregnancy. On the other hand, it is
very unwise for an expectant mother to cut down her diet, with the
idea of keeping the baby small and thus make labor easy, except
under the direction of her doctor. In general it is the size of the
baby’s head that makes labor easy or difficult, and not the amount of
fat distributed over his body. And if the mother cuts down the
minerals in her diet to make the baby bones soft, the only result is
that her own bones and teeth are softened, because the baby extracts
from them enough lime to supply what the food lacks.
Three meals a day will usually be enough during at least the first
half of pregnancy and they should be taken with clock-like regularity,
eaten slowly and masticated thoroughly. The possible need for slight
additional food during the later weeks may be supplied more
satisfactorily by lunches of milk, cocoa or broth and crackers or toast,
between meals and upon retiring, than by taking larger meals. An
expectant mother who has a tendency to nausea early in pregnancy
often feels better for taking a small lunch regularly five or six times
daily instead of the usual three full meals.
It is of the greatest importance that every pregnant woman drink
an abundance of fluid to act as a solvent for her food and waste
material and promote the activity of her kidneys, skin and bowels.
She needs about three quarts daily, most of which should be water,
the remainder consisting of milk, cocoa, soup and other liquids.
Alcohol should not be taken except upon the doctor’s orders and only
moderate amounts of coffee and tea, unless he gives permission for
more.
The expectant mother will be wise to avoid fried food, pastry, rich
desserts, rich salad dressings and any other food which would
ordinarily disagree with her.
Since the enjoyment of one’s meals promotes digestion at all times,
the expectant mother should try to eat the things that she enjoys
most and that agree with her. The average pregnant woman who has
no symptoms of complications will usually be able to supply her own
and her baby’s needs and at the same time keep within the bounds of
safety if she selects her diet from the foods included in the following
groups:
Animal Foods. Milk and eggs are the most satisfactory, but for
the sake of variety and to tempt her appetite the expectant mother
will usually be allowed to take rather sparingly, and preferably only
once a day, of fish, the various kinds of shell fish, beef, lamb, chicken
or game. Pork, veal and goose should be avoided as a rule, and
particularly by women with whom they ordinarily disagree.
Soups. Thin soups and broths have little food value but because
of their appetizing flavor and aroma are an aid to digestion, and
frequently by stimulating a flagging appetite will help the expectant
mother to eat and assimilate more than she would without them. But
cream soups and purées have a high food value and, like thin soups
and broths, also supply a definite amount of fluid which she must
have.
Vegetables. The group of vegetables generally designated as
“leafy” are of even greater importance to the expectant mother than
they are to the average person. Of these she may safely eat onions,
asparagus, celery, string beans, spinach, and she should make a point
of taking a green salad, such as lettuce, cress or romaine, at least
once daily. Sweet potatoes, white potatoes, rice, peas, Lima beans,
tomatoes, beets and carrots, also, may be eaten with safety, as a rule,
but cabbage, cauliflower, corn, egg-plant, Brussels sprouts, parsnips,
cucumbers and radishes should be taken with great caution and
avoided altogether if they cause gas or any kind of distress.
Fresh Fruits. A necessary part of the diet is fresh fruit, and
among those fruits which are both beneficial and usually harmless
are apples, peaches, apricots, pears, oranges, figs, cherries,
pineapple, grapes, plums, strawberries, raspberries, blackberries and
grapefruit. These are more likely to be laxative if eaten alone, as
before breakfast and at bedtime. Cooked fruits are also valuable
articles of diet, but are probably less laxative than raw fruit. Some of
the citrous fruits, oranges, grapefruit or lemons, should be taken
daily because they possess a certain indispensable food value which
is peculiar to them.
Cereals. For their nourishing and laxative qualities, cereals are
important and their food value is increased by the milk and cream
which are usually taken with them. Cooked cereals should invariably
be cooked longer than the usual directions suggest. Bran, eaten alone
as a cereal or in combination with other grains, is an excellent
laxative.
Breads. Graham, cornmeal, whole wheat and bran bread are all
good, in general the expectant mother will be on the safe side if she
eats sparingly, if at all, of very fresh or hot breads and hot cakes.
Desserts. Desserts are very important for they add to the
attractiveness of most people’s meals, and if wisely chosen and
properly made, may supply a good deal of easily digested
nourishment. They may include, in addition to fresh and cooked
fruits and preserves, ice-cream, a wide variety of custards, creams
and puddings made largely of milk, eggs and some ingredient to give
substance and firmness, such as gelatin, cornstarch, rice, tapioca,
farina, arrow-root and similar materials.
In general the expectant mother should eat an abundance of fruit
and vegetables, taking at least some uncooked fruit and a green
salad, daily, and make sure that her food contains a good deal of
residue, such as is provided by fruit and coarse vegetables. This
residue increases the bulk of the material in the intestines, and this
helps to overcome the tendency toward constipation. As fat is less
easily digested than starchy foods, and more likely to cause nausea
during pregnancy, it is better to eat no more fat than usual but to
supply the additional material which is needed after about the sixth
month, by taking a little more starchy food. However, a slight
increase only is necessary, and this chiefly during the last three or
four weeks.
The Kidneys. It is scarcely possible to say enough about the
importance of keeping your kidneys in normal working order during
pregnancy, for through them is excreted much of the waste matter
from your baby’s body as well as your own. Sometimes when these
impurities are not thrown off as they should be the expectant mother
has convulsions. You will be glad to know how much you yourself can
do toward preventing convulsions by drinking plenty of water and by
faithfully measuring your urine and taking a specimen to the doctor
when he asks you to. As I said before, you should drink at least three
quarts of fluid every day. Most of this should be water, the remainder
being milk, cocoa, soup, tea, coffee, and so on.
The doctor will probably want you to measure your urine and take
a specimen to him once a month during the first half of pregnancy
and every two weeks afterward, or even every week toward the end.
He can tell by examining the urine whether your kidneys are acting
as they should and if they are not he may save you serious trouble by
putting you to bed for a few days with no nourishment but milk and
water.
In preparing a specimen you will need a covered corked vessel
large enough to hold all the urine passed in twenty-four hours, and it
must be thoroughly washed and scalded. The next step is to pass
urine, suppose we say at eight o’clock in the morning, and throw it
away. All of the urine which you pass after this time until eight
o’clock the next morning must be saved in the vessel and kept in a
cool place to prevent its decomposing. If you will put a teaspoonful of
chloroform or boracic acid powder into the vessel it will tend to
preserve the urine and will not injure the specimen. At the end of
twenty-four hours the urine should be shaken to mix it thoroughly
and about half a pint poured into a bottle that has been washed and
scalded. Carefully cork and label this with the date, your name and
address and the total amount of urine passed in the twenty-four
hours. The vessel for collecting the urine and whatever you use as a
measure should be reserved for these purposes only. If you have no
tin or glass measure, a regular-size quart tomato can will prove
entirely satisfactory.
If you find, when measuring your urine, that you pass less than a
quart and a half in twenty-four hours, you may know without being
told that this is not enough and that you should drink more water.
The Skin. People are likely to think of the skin as being simply a
covering for the body, whereas, in reality, it is a very complicated and
active organ which helps to regulate the body temperature and
constantly throws off impurities, just as the kidneys do. This latter
function is performed by the sweat glands which open upon the
surface of the skin as the “pores,” and we are told that in all there are
some twenty-eight miles of these tiny tube-like structures in the skin.
These glands should be, and usually are, constantly active; they pour
upon the surface of the body an oily substance which keeps the skin
soft; they also excrete something more than a pint of water daily,
which contains impurities that are harmful if retained in the body.
We are not aware of this constant excretion of fluids, which is termed
“insensible perspiration,” but it continues even in cold weather and
must not be stopped if health is to be preserved. If the oil, dust,
particles of dead skin and the waste material left by dried
perspiration are allowed to remain upon the surface of the body they
will clog the pores, or gland openings, and thus interfere with their
action. The removal of this material, then, is necessary to maintain
health, and is done automatically in part for the fluid evaporates and
much of the solid matter is rubbed off on the clothing. The most
important aids to the skin’s activity are the drinking of plenty of
water, deep breathing, exercise and warm baths.
Regular and thorough bathing serves the double purpose of
removing waste matter already on the surface, and of stimulating the
glands to increased activity in giving off still more.
Many doctors advise a warm, not hot, shower or tub bath every
day, with soap used freely over the entire body, followed by a brisk
rub. The best time for this warm, cleansing bath, as a rule, is just
before retiring, as it is soothing and restful, and tends to induce
sleep. Very hot baths are fatiguing, particularly during pregnancy,
and should never be taken except with the doctor’s permission; but
cold baths usually may be continued throughout pregnancy if one is
accustomed to them and reacts well afterwards. Under these
conditions the morning cold plunge, shower or sponge is beneficial,
as it stimulates the circulation and thus promotes the activity of the
skin. Some doctors forbid tub bathing of any kind after the seventh
month, on the ground that as the expectant mother sits in the tub her
vagina is filled with unsterile water and should labor occur shortly
afterward an infection, or fever, might result. And as she is heavy and
somewhat uncertain on her feet, there is also the danger of her
slipping and falling while getting in or out of the tub. Other doctors
permit tub baths throughout pregnancy, up until the onset of labor;
while as to hot foot baths, since there seems to be no reason for or
against them at any time during the nine months, they may be taken
or not at will.
Bathing in a quiet stream or lake is apparently harmless but sea
bathing, if the surf is rough, is inadvisable because of the beating of
the waves upon the abdomen and the general violence of the
exercise.
The importance of keeping the body evenly warm throughout
pregnancy cannot be overemphasized, for a sudden chilling or
wetting may so check action of the skin as to impose more of a
burden upon the kidneys than they can meet, in their effort to throw
off the skin’s share of the body waste. Accordingly, a single chilling
will sometimes be enough to cause convulsions. This may be one
reason why convulsions occur more frequently during cold weather
or after a sudden drop in the temperature after warm or mild days.
The Bowels. The bowels, also, throw off a certain amount of
impurities and if they do not move thoroughly at least once a day
these impurities may be taken into the system and again the kidneys
be given extra work.
Unhappily a great many pregnant women are constipated,
particularly during the later weeks, while women who have always
had a tendency of this kind may have trouble with their bowels from
the very beginning of pregnancy. Your bowels should move regularly
every day, and to this end you should attempt to empty them at the
same hour each day, immediately after breakfast being the best time.
The importance of regularity in making the attempt cannot be
overemphasized, even though the bowels do not always move.
The measures which tend to prevent constipation, as already
pointed out, are drinking plenty of fluids, and eating fresh fruit,
coarse vegetables and bulky cereals such as bran; also taking a glass
of hot or cold water just before going to bed and the first thing in the
morning. You should not take enemas or cathartics without your
doctor’s order, but you may safely increase the amount of fluids
which you drink and the bulk of your food, in order to regulate your
bowels.
Senna and prunes cooked together prove to be helpful in keeping
the bowels regular and they are entirely harmless. A simple way of
preparing them for this purpose is to pour a quart of boiling water
over an ounce of senna leaves and allow them to stand for about two
hours. A pound of well washed prunes should soak overnight in this
liquor, after it has been strained, and then cooked in it until tender.
They may be sweetened with two tablespoonfuls of brown sugar, and
the flavor improved by adding a stick of cinnamon or slice of lemon
while they are cooking. Half a dozen of these prunes, with some of
the syrup, may be taken at the evening meal to start with, and
increased or decreased in number as necessary.
Clothes. The chief purpose of clothes under all conditions is to
aid in keeping the body warm, thus helping to preserve an even
circulation of the blood and the activity of the sweat glands. As has
been pointed out, this is of especial importance during pregnancy.
The expectant mother’s clothes should be not only sufficiently warm,
but they should be equally warm over her entire body. They should
be light and porous, and fairly loose, so as not to interfere with the
circulation or other bodily functions. There must be no pressure on
chest or abdomen; no tight garters, belts, collars or shoes.
The clothes of the mother-to-be, like every other detail of her care,
must be adapted to her surroundings and mode of living. If her
house is well and evenly heated during the cold months, she may
quite safely dress lightly while indoors; if it is not, she should wear
underwear with high neck, long sleeves and drawers, both indoors
and out, except when the weather is warm enough to cause
perspiration. At all times, however, the warmth of her clothing
should be suited to the temperature of the home, the climate and the
state of the weather.
Remembering that it is important for you to keep up the diversions
and amusements that you enjoy, it is worth while to have your
clothes as pretty and becoming as possible, for you are much more
likely to go about and mingle with your friends if you feel that you
are becomingly and well dressed. At the same time your clothes
should be so made that their weight will hang from the shoulders
instead of from the waistband.
And that brings us to the question of corsets, a much discussed
garment. Women who have not been accustomed to wearing corsets
will scarcely feel the need of adopting them during pregnancy except,
perhaps, during the later weeks when the heavy abdomen needs to be
supported for the sake of comfort. This need is felt particularly by
women who have had children and whose abdominal walls are
somewhat weakened in consequence.
If you have been wearing comfortable, well fitting corsets, you
probably will not feel the need of making a change until the third or
fourth month. But by this time the baby will have pushed up out of
the lower pelvis into the abdomen and your corsets then, if you wear
any, must be so constructed that they will not compress nor disguise
your figure, but will provide support and accommodate themselves
to an abdomen that is steadily increasing in size and changing in
shape. Such corsets are made of soft material; have elastic inserts
and have lacings at the sides as well as in the back. They come well
down and fit snugly over the hips. (See Fig. 10.) Some women find
comfort in attaching shoulder straps to their corsets thus suspending
some of the abdominal weight from the shoulders. But as a rule, the
most comfortable arrangement is a short-waisted maternity corset
worn with a brassière that supports the breasts and does not
compress the nipples.
I hope this description will make clear to you why the same style
corsets as you ordinarily wear cannot be satisfactory during
pregnancy, no matter how large they are, and may even prove
harmful.

Fig. 10.—Front and side views of


a satisfactory maternity corset,
adjusted at the fifth month of
pregnancy. (By courtesy of
Emma E. Goodwin, New York.)
Fig. 11.—Front, side and back
views of home-made binder for
supporting a heavy, pendulous
abdomen during later weeks of
pregnancy. It is adjusted as the
expectant mother lies down, the
ends being crossed in the back
and pinned to the lower margin
of the front, thus giving
additional support.

Also breast-binder made of a


straight strip of soft cotton
material, 10 or 12 inches wide
and 2 yards long. This is crossed
in front and held with safety-
pins, the ends being carried over
the shoulders and pinned to the
back of the binder. It should be
snug below the breasts but loose
over the nipples. The openings
over the nipples show how this
binder may be used to support
the breasts of the nursing
mother. (From photographs
taken at the Maternity Centre
Association, New York.)

Even a properly fitting maternity corset may become


uncomfortable during the last few weeks of pregnancy, and have to
be replaced by an abdominal supporter of linen or rubber. And when
this stage is reached, even the woman who has worn no corsets may
find that she is more comfortable if she adopts such a support,
particularly at night. There are many admirable binders on the
market, or such an one as is illustrated in Figs. 11 and 12 may easily
be made at home as well as comfortable and inexpensive stocking
supporters, made from tapes or strips of muslin, as in Fig. 13.

Fig. 12.—Abdominal binder used in Fig. 11, showing darts at top of


front to fit it over the abdomen.

Your shoes, also, merit some thought, for your feet will probably
be larger during the latter part of pregnancy, partly because of the
possibility of their being somewhat swollen and partly because the
increased weight of your body tends to spread them. This added
weight also increases the strain put upon the arch and as a result,
flat-foot is fairly common among expectant mothers who have not
taken pains to have their arches well supported. Your shoes would
better be an inch longer than those you ordinarily wear; they should
have broad, common sense heels and fit snugly over the instep, in
spite of being full large. If your shoes are not comfortable you will
find yourself tiring easily and for this reason will tend to take less
exercise than you should.
Another reason for the need of proper shoes is that as pregnancy
advances the expectant mother becomes rather unsteady on her feet,
and broad, firm heels help to make her feel more secure. The heels
need not be flat at first, if you have been accustomed to wearing high
ones, for the sudden lowering of the heels may injure your arches,
but as the weeks wear on you would better adopt moderately low
heels. High French heels should be avoided because they not only
increase the difficulty and discomfort of walking but cause backache,
as well, by forcing a position that adds to the pressure on the lower
part of the abdomen. They increase the risk of turning the ankles,
too, and of tripping and falling, which is a very serious accident for
the expectant mother.

Fig. 13.—Front and back view of


home-made stocking supporters
made of webbing or 1–inch
strips of muslin and a pair of
child’s side garters. The straps
are sewed together in the back,
but pinned in front to permit
adjustment as the abdomen
enlarges. (By courtesy of the
Maternity Centre Association,
New York.)

Fresh Air. If you realize by this time how important it is to keep


your digestion in good order and promote the activity of all your
excretory organs, you probably suspect how important fresh air and
exercise are to you and your expected baby, because of their effect
upon your entire well-being.
The average individual uses up in a minute’s time the oxygen
contained in four bushels of air, and since the pregnant woman takes
in through her lungs the oxygen for both herself and her baby, she
must have a sufficient quantity of air to supply at least this amount.
Accordingly, you should make a point of spending at least two
hours of each day in the open air. If the weather is so stormy or
severe as to make it undesirable for you to go out from under cover,
because of the danger of getting wet or chilled, you can wrap up well
and take your airing on a protected porch or in a room with all the
windows wide open.
But this is only a part of it, for the air in your house or rooms must
be kept fresh all day by being constantly changed; this requires a
steady inpouring of fresh air and outpouring of stale air.
A very good way to accomplish this is to have one or more
windows open slightly, top and bottom, all the time. But there must
be no sudden changes of temperature, nor drafts, for fear of chilling
your skin. At night you should sleep in a room with the windows
open, taking care to be well protected by light, warm coverings.
Exercise. Each detail of the expectant mother’s daily routine
seems to be more important than the last. And so when we come to
the question of regular out-of-door exercise we are almost persuaded
to believe that whatever else may be neglected, this is indispensable,
since it promotes digestion, stimulates the activity of the skin and
lungs, steadies the nerves, quiets the mind and promotes sleep. And
more than that, walking, which is probably the most satisfactory
form of exercise for her to take, also strengthens some of the muscles
that are used during labor. But exercise is downright injurious if
continued to the point of fatigue, no matter how little has been taken.
Each woman must be a law unto herself in this matter, therefore, and
must be impressed with the importance of stopping before she is
tired. It may be a good plan for you to start by walking only a short
distance at a time, increasing this gradually until you are able to walk
possibly as much as an hour in the morning and an hour in the
afternoon without fatigue.
All violent exercise and sports are of course to be avoided,
particularly swimming, horseback riding and tennis. While motoring
and carriage driving are pleasant diversions, they cannot be classed
as exercise. They should be taken only in comfortable vehicles and
over smooth roads, so that there will be no jarring nor jolting, and
the expectant mother should not do the driving herself.
A certain amount of exercise, in the shape of light housework, may
be taken indoors. This is distinctly beneficial if not continued to the
point of fatigue, both because of the exercise which it provides, and
also the diversion and interest, for these promote mental and
physical health. But this indoor exercise must not interfere with, nor
to any degree replace the daily exercise which you take out of doors;
nor must it include heavy work, such as washing, sweeping, heavy
lifting, running a sewing machine by foot or much running up and
down stairs.
However, the amount and kind of work which the expectant
mother may comfortably and safely do, are so related to what she has
been accustomed to, that it is not possible to do more than describe
what has proved of benefit for the average woman.
There are women to whom massage and gymnastics are helpful
during pregnancy when for some reason the out-of-door activities
are not possible or advisable. This might be true of an expectant
mother with heart trouble, for example, or of one who is being kept
in bed to prevent an abortion and accordingly is a matter which is
closely directed by the doctor.
Traveling. In general, traveling is less dangerous for the
expectant mother of to-day than formerly because it causes less
strain, discomfort and fatigue than in the old days. But the question
cannot be settled once for all women nor for all stages of pregnancy.
Each woman’s general condition must be considered; her tendency
to nausea; the length of the journey and the ease with which it may
be made; also, whether or not she has ever had or been threatened
with an abortion. As a rule, it is considered wise to avoid traveling
during the first sixteen and the last four weeks of pregnancy, and at
the time of the month when menstruation would ordinarily occur.
Certainly a journey should not be undertaken at any time during
pregnancy without a doctor’s permission.
Rest and Sleep. When we studied the changes that take place
during pregnancy we found that as the abdomen increased in size
and weight the expectant mother was required to make a constant,
though unconscious effort to stand upright. This is probably one
reason for the fatigue which she so often feels without apparent
cause, and why, upon exertion, she tires more easily than usual.
Accordingly, you may find it necessary to rest frequently during
the day in order to avoid the ill effects of fatigue. It is a good plan to
work and exercise in short periods rather than long, always lying
down when tired, and for an hour or two after the noon meal. You
should be careful not to be over active or to overexert yourself at the
time when menstruation would occur if you were not pregnant, for
fear of bringing on an abortion. This precaution is particularly
important during the first four months, the period when abortions
occur most frequently.
Since eight hours’ sleep is usually considered necessary to keep the
average person in good condition, you can scarcely expect to get
along satisfactorily with less. In fact, this is so important to your
general well-being that you should make a serious effort to secure it.
Fresh air during the day and open windows at night; prudent
eating; a comfortable bed furnished with warm but light bedding;
warm baths; a hot water bag to the feet and a hot drink upon retiring
are all conducive to sleep.
But in addition to these, and perhaps of even more importance, are
cheerfulness and a tranquil, untroubled state of mind.
Breasts. Breast feeding is the most urgent single need of the
baby, for whose coming we are making preparations, and practically
every mother, excepting those with definite physical disability, can
supply this need of her baby’s if she gives herself proper care both
before and after his birth. You will be glad to know in this connection
that everything that promotes your general health helps to prepare
you to nurse your baby, but there is need also for care of the breasts
and nipples themselves, to make the nursing satisfactory, and to
prevent sore nipples and possibly even breast abscesses.
Briefly, this local care consists of supporting heavy breasts, but
avoiding pressure; bringing out flat or retracted nipples and
toughening the skin which covers them.
After they become heavy and uncomfortable the breasts may be
supported by brassières, which are snug below the breasts, loose over
the breasts themselves and suspended from shoulder straps; or by
some such binder as is shown in Fig. 11, which answers the same
purpose.
If your nipples are flat or retracted, you should begin about the
fifth month to make them more prominent in order that when the
baby nurses he may be able to grasp them easily. There are several
ways of accomplishing this, all of them in the nature of massage, but
whatever is done must be done regularly and persistently. One
simple and effective method is to grasp the nipple between the
thumb and forefinger, draw it out, hold it for a moment, then release
it and allow it to retract. This should be done over and over, two or
three times daily. Or the unstoppered opening of a warm bottle may
be placed over a flat nipple and held in place until the nipple is
drawn up into the neck of the bottle as it cools and a partial vacuum
is formed.
The toughening of the nipples should be begun eight weeks before
the baby is expected. There are two general methods which seem to
give about equally satisfactory results. One is to soften the skin, and
the other is to harden it. In either case the nipples should first be
scrubbed gently with a soft brush or cloth, warm water and soap, for
about five minutes night and morning. After the scrubbing they
should be rubbed with lanolin, cocoa butter or vaselin and covered
with a piece of clean soft cloth or gauze, to protect the clothing. Or,
they may be bathed with a wash consisting of equal parts of a
saturated solution of boracic acid and 95 per cent alcohol. You will
probably have to have a druggist prepare this for you because of the
alcohol.
But no matter which course is followed the care must be regular to
be effective. You will find that matters will be simplified if you will
assemble in one place and keep in readiness the soap, brush and
lotion or ointment which you use each time, using them for no other
purpose.
Care of the Teeth. It is very important for the expectant mother
to give her teeth scrupulous care from the beginning of pregnancy,
for in addition to the ordinary wear and tear with which we all have
to cope, her tendency to have an acid stomach makes her mouth acid
and this is bad for her teeth. Accordingly, in addition to using dental
floss and brushing your teeth after each meal, you should use an
alkaline mouth wash several times daily, particularly after vomiting
and before retiring, for much damage may be done by the acid
secretions in the mouth if they are allowed to bathe the teeth during
the long night stretches. Common baking soda (a teaspoonful to a
tumbler of water), lime water or milk of magnesia all make excellent
mouth washes. It is important, also, that you consult a dentist as
soon as you know that you are pregnant and have any necessary
repairs done promptly, for delay may be serious.
COMMON DISCOMFORTS DURING
PREGNANCY
You may have a number of minor ills and temporary disturbances
during pregnancy which are not serious but capable of making you
very uncomfortable, and which you may sometimes relieve yourself.
But should they be severe or persistent, you should consult your
doctor at once. The most common of these minor discomforts may be
grouped as digestive disturbances and “pressure symptoms.”
Chief among the digestive disturbances are “morning sickness,”
“heartburn,” “distress” and flatulence or “gas.”
“Morning sickness” is probably the commonest discomfort of
pregnancy as it occurs in about half of all cases. Because of the
expectant mother’s tendency to nausea during the early months, it
may be brought on by slight causes which would not produce nausea
under ordinary conditions. While it is true that grief, anxiety, fright,
shock, incessant worry, fits of temper or brooding may induce
nausea when the diet is entirely satisfactory, nausea and even
vomiting may be caused in the expectant mother just as they may in
any one else by indiscretions in diet, rapid or overeating. On the
other hand, simple, light food taken in small quantities, five or six
times daily, eaten slowly and masticated thoroughly; the cultivation
of a happy frame of mind; exercise and fresh air all tend to prevent
this very uncomfortable condition.
Prevention is of great importance, as the habit of vomiting is
acquired easily but broken up with difficulty.
When “morning sickness” occurs, however, the sufferer is often
relieved by eating two or three hard, unsweetened crackers or crisp
toast, immediately upon awaking and then lying still for half or three
quarters of an hour. She should then dress slowly, sitting down as
much as possible while doing so, and eat her regular breakfast. Lying
flat, without a pillow for a little while after meals, or whenever
having the slightest feeling of sickness, will frequently prevent, and
also relieve nausea. Sometimes comfort is derived from the use of
either hot or cold applications over the stomach. Some expectant
mothers find that they can prevent nausea by having hot coffee, or
even a full breakfast before arising. But the habit of having breakfast
in bed should not be cultivated lightly, for in spite of yourself it is
likely to make you feel like an invalid, the thing you should carefully
avoid. So don’t do it unless your doctor orders it.
“Heartburn,” so called, which is suffered by so many expectant
mothers, has nothing to do with the heart. It is due entirely to too
much acid in the stomach and is usually felt as a burning sensation,
which starts in the stomach and rises into the throat. It may be
prevented, as a rule, by taking a tablespoonful of olive oil or a cupful
of cream or rich milk fifteen or twenty minutes before meals and
avoiding fat and fried food at the meals themselves. Or, it may be
enough simply to avoid eating fats and fatty foods. Since the painful,
burning sensation is directly due to too much acid in the stomach, it
usually may be relieved by taking a tablespoonful of lime water; a
teaspoonful of sodium bicarbonate in water; a small piece of
magnesium carbonate; or a drink of any alkaline water that one
fancies.
“Distress.” Another common discomfort of pregnancy is called
“distress” by the sufferers themselves, and occurs after eating. It may
be neither heartburn nor pain, but resemble both and make the
expectant mother very miserable. It is usually suffered by women
who eat rapidly, do not chew their food thoroughly or who eat more
at one time than the stomach can hold comfortably. This is one more
reason for taking small amounts of food at a time, eating slowly and
masticating thoroughly.
Flatulence, or “gas,” may or may not be associated with
heartburn, but is fairly common among expectant mothers, and is
rather uncomfortable. A daily bowel movement is of prime
importance in preventing and relieving flatulence and at the same
time foods which form gases should be carefully omitted from the
diet. The chief offenders are parsnips, beans, corn, fried foods,
sweets of all kinds, pastry and very sweet desserts. Yeast cakes and
artificially fermented milk sometimes help to prevent flatulence.
Pressure Symptoms. Under the general heading of pressure
symptoms are several forms of discomfort resulting from pressure of
the enlarged uterus (containing the baby) on the blood-vessels which
return from the lower part of the body, thus interfering with the flow
of blood back to the heart. The commonest pressure symptoms are
swollen feet, varicose veins, hemorrhoids (piles), cramps in the legs
and shortness of breath. They may appear at any time during the last
half of pregnancy and they grow worse as the weeks wear on.

Fig. 14.—Right-angled position


to relieve swelling or varicose
veins of the feet and legs. (By
courtesy of the Maternity Centre
Association.)

Swelling of the feet is very common, and when very slight may
not be serious or particularly uncomfortable. The swelling may be
confined to the back of the ankle, which grows white and shining, or
it may extend all the way up the legs to the thighs. Sitting down, with
the feet resting on a chair, or lying down with the feet elevated on a
pillow will give a certain amount of relief. If the swelling and
discomfort are extreme, the expectant mother may have to go to bed
until they subside, but very often she will be relieved by elevating her
feet or assuming the right-angled position shown in Fig. 14, for even
a little while, several times a day. But while employing these
harmless measures to make yourself comfortable, you must
remember that the swelling of your feet and ankles is one of the
symptoms that your doctor wants to know about. For this reason you
should promptly report to him even the slightest swelling and begin
to measure and save your urine for examination.
Varicose veins are not peculiar to pregnancy but they are among
the pressure symptoms which frequently appear during the later
months, particularly among women who have borne children. The
enlargement of the veins is not usually serious but it may cause a
good deal of discomfort. While varicose veins may occur in the vulva,
they are usually confined to the legs, and both legs are about equally
affected. Sometimes, however, the veins in the right leg are more
distended than those in the left, or the right side alone may be
affected.
Considerable relief may be obtained by keeping off the feet,
particularly by elevating them, and also by the use of elastic
bandages. When an expectant mother finds it difficult or nearly
impossible to sit or lie down for any length of time, she may secure
great relief in a few moments by lying flat on the bed with her legs
extended straight into the air, at right angles to her body, resting
against the wall or head board, as shown in Fig. 14. This right-angled
position for five minutes, three or four times a day, will accomplish
wonders in reducing varicose veins.
A spiral elastic bandage, also, will give comfort and help to prevent
the veins from growing larger, if applied freshly after each time that
the leg is elevated. The most satisfactory bandages, from the
standpoint of expense, comfort and cleanliness, are of stockinette or
of flannel cut on the bias, measuring three or four inches wide and
eight or nine yards long. If made of flannel, the selvages should be
whipped together smoothly so that there is neither ridge nor pucker
at the seam. The bandage should be wrapped around the leg with
firm, even pressure, starting with a few turns over the foot to secure
it, and leaving the heel uncovered, carried up the leg to a point above
the highest swollen vessels. As a rule the bandage may be left off at
night.
There are satisfactory elastic stockings on the market, but they are
fairly expensive, often cannot be washed and seem to offer no
practical advantage over the bandages.
Swollen veins in the vulva may be relieved by lying flat and
elevating the hips, or by lying on the side with the hips elevated on a
pillow for a few moments several times a day, as shown in Fig. 15.
Fig. 15.—Lying on the side with hips elevated to relieve swelling or
varicose veins of the vulva. (By courtesy of the Maternity Centre
Association.)

Hemorrhoids, or “piles,” are virtually varicose veins which


protrude from the rectum, but, unlike those in the legs, are extremely
painful. As it is the straining in constipation that causes these
enlarged veins to protrude from the rectum, this is one more reason
for preventing constipation, for a pregnant woman whose bowels
move freely every day rarely has hemorrhoids. If hemorrhoids
appear, and give pain, the first step is to soften the fingers with
vaselin and gently push the hemorrhoids back into the rectum. You
can do this quite easily for yourself. You should notify your doctor if
you have hemorrhoids, but while waiting to see him, if you are very
uncomfortable you will be almost certain to find relief in lying down
with your hips elevated on one or two pillows; applying an ice bag to
the rectum, or ice-cold cloths or cloths wrung from equal parts of
water and witch hazel. Sometimes the hemorrhoids are worse during
the first few days after the baby is born but as a rule they disappear
when the ultimate cause is removed, which in this case is pressure
made by the baby.
Cramps in the legs, numbness or tingling may be caused by
pressure of the large, heavy uterus upon nerves supplying the lower
extremities. Lying down, applying heat and rubbing the painful parts
will usually relieve the discomfort.
Shortness of breath is sometimes very troublesome toward the
end of pregnancy, and as may be easily understood, is due to the
upward, and not downward pressure of the uterus. For this reason
the discomfort is made worse by lying down and relieved by one’s
sitting up or being well propped up on pillows or a back rest.
Vaginal Discharge. Although the normal vaginal discharge is
increased during the later months of pregnancy you should tell your
doctor if your discharge is very free. You should not take douches to
remove it, unless your doctor orders them, for the normal discharge
gives you a certain amount of protection against infection. If it is
irritating or causes itching or burning you may obtain relief by
avoiding the use of soap and by bathing the uncomfortable parts with
water, containing a teaspoonful of sodium bicarbonate to a pint, or
with olive oil.
Itching of the skin is a fairly common discomfort, and is
possibly a result of irritating material being excreted by the skin
glands and deposited upon the surface of the body. The local
irritation usually may be relieved, if not very severe, by bathing the
uncomfortable areas with the solution of sodium bicarbonate as
above, or a lotion consisting of a pint of lime water, half an ounce of
glycerin and thirty drops of carbolic acid. It is a good plan, also, to
drink more water, in order to promote the activity of the skin,
kidneys and bowels, and thus dilute the material that may be
responsible for the itching and increase its elimination through all
channels.
Some women complain of discomfort caused by the stretching of
the skin over the enlarged abdomen. There is a very old belief that
rubbing the skin with oil will relieve this sensation and also prevent
the appearance of the purplish streaks described in a previous
chapter. There seems to be little foundation for this belief, but if a
woman fancies that she is safer and more comfortable after oiling her
abdomen, there is certainly no reason why she should not do so.
HELPING TO PREVENT COMPLICATIONS
I have described to you the details of personal hygiene which your
doctor is likely to want you to adopt during your months of
expectancy, and some of the simple things that you may do to relieve
minor discomforts when they arise, for having these things in black
and white may make the whole matter a little easier for you.
But there is still more that you can do to help the doctor help you.
You can tell him about any discomfort or any new condition that
appears, and follow his advice instead of talking it over with your
family or friends. This will make it possible for him to prevent
serious complications by treating them in the very beginning.
You have probably learned, in one way or another, that the
complications associated with childbirth that are most serious are
infections (childbed fever), convulsions, abortions or miscarriages
and severe bleeding, but perhaps you have not heard that you,
yourself, can help greatly in the prevention of all of these conditions,
in your own case, and chiefly by little more than exercising good
common sense.
Your part in preventing childbed fever, if your baby is to be born at
home, lies in having in readiness a clean room, sterile sheets, towels,
gauze pads, etc., as will be described in the next chapter.
Concerning the other complications we shall say a word here.
Convulsions. You can do a great deal toward preventing the
condition that causes convulsions by following the advice about your
personal care that we have just gone over and by making it possible
for the doctor to treat early symptoms promptly. In fact, after looking
over the records of many thousands of mothers who have had
prenatal care, it seems almost safe to say that the expectant mother
who follows such a course will not have convulsions.
One of the commonest of the early symptoms is headache,
sometimes persistent and very severe. Others which you can detect
are blurred vision, spots before the eyes, dizziness, vomiting which is
more persistent or severe than could be called “morning sickness,”
puffiness under the eyes or elsewhere about the face or hands,
swelling of the feet and ankles and severe pain in the stomach. It
might be that if you had even one of these symptoms your doctor
would think it worth while to put you to bed and give you nothing
but milk, or only water, for a day or two, not because you were sick,
but to keep you from being so, on the same principle that you darn a
thin place in a stocking to keep a hole from coming.
In any event, tell your doctor about the symptoms and let him
decide what is to be done, for therein lies your safety.
Miscarriages. The question of abortions, miscarriages and
premature births is one of enormous importance, and one about
which there is a good deal of misunderstanding. As to the meaning of
the terms, many women are puzzled to know the difference between
them. Doctors are not likely to use the word miscarriage, but will
describe as an abortion a termination of pregnancy which occurs
before the end of the seventh month and as premature labors those
occurring from that time until the expected date of confinement. In
the minds of lay people, however, the term abortion is often
associated with criminal practice, miscarriage being a term loosely
applied to all births occurring before the seventh month, while the
premature baby is the one born after the seventh month of
pregnancy but before the expected date of confinement.
Of all of these accidents, abortions are the most frequent, though
in the nature of things it is impossible to say how often they occur.
They sometimes happen so early in pregnancy that the expectant
mother is unaware of the accident; or if she does know of it she may
make the mistake of taking no notice of it or regard it of so little
consequence that she does not consult a doctor. But such
information as is available suggests that at least one out of every five
pregnancies ends in abortion, the tragedy of this being that it is very
largely a preventable disaster.
Since the ovum is insecurely attached to the uterine lining until the
sixteenth or eighteenth week, an abortion is more likely to occur
during this time than later, while of this period, the second and third
months seem to be the most perilous. Abortions are less likely to
happen during first pregnancies than succeeding ones and their
frequency seems to increase with the number of pregnancies. They
occur more often among women over thirty-five years than in
younger ones, and in all cases are most likely to take place at the time
when menstruation would fall due were the woman not pregnant.
The prevention of abortions is of such obvious importance and
there is so much that you can do to this end, that we shall take up the
question somewhat at length. Preventive treatment really begins very
early. In the discussion about menstruation we referred to the
importance of finding out the cause of painful periods, in the interest
of good obstetrics, since inflammation of the uterine lining or a
misplaced uterus might be responsible for the pain and if neglected
might cause an abortion later on. The correction of such troubles, no
matter when they are discovered, is an early step toward preventing
abortions.
But after pregnancy has actually begun, there are certain
preventive measures which have proved to be very effective. A
woman who is pregnant for the first time, and who, therefore, does
not know whether she is likely to have an abortion or not, should
avoid such risks as fatigue, sweeping, lifting or moving heavy objects,
running a sewing machine by foot, running, jumping, dancing,
traveling or any action which might jar or jolt her during the first
sixteen or eighteen weeks.
An expectant mother who has had an abortion will have to take
even greater precautions, as she is in more danger than is a woman
who has not had this experience. It is of prime importance, to begin
with, that she have the cause of her previous abortion discovered,
and if possible corrected. And since the accident is most likely to be
repeated at about the same time, or a little earlier, in each succeeding
pregnancy it is a wise precaution for the expectant mother to remain
quietly in bed for at least a week before and after the time when an
abortion may be feared.
Complete rest and relaxation are such effective preventive
measures that patients with a tendency to have abortions who have
been willing to stay in bed during most of their pregnancy have
sometimes been rewarded by going through the entire period and in
the end giving birth to a normal, fully developed baby. As out-of-
door exercise is clearly impossible in such cases, it is important that
the patient keep her room very well ventilated all of the time, and
possibly, under the doctor’s direction, have massage or bed exercises.

You might also like