Foundations of Data Science with Python 1st Edition John M. Shea All Chapters Instant Download
Foundations of Data Science with Python 1st Edition John M. Shea All Chapters Instant Download
com
https://ebookname.com/product/foundations-of-data-science-
with-python-1st-edition-john-m-shea/
OR CLICK HERE
DOWLOAD NOW
https://ebookname.com/product/data-science-from-scratch-first-
principles-with-python-1st-edition-joel-grus/
ebookname.com
https://ebookname.com/product/managing-your-biological-data-with-
python-1st-edition-via/
ebookname.com
https://ebookname.com/product/data-visualization-with-python-and-
javascript-scrape-clean-explore-transform-your-data-1st-edition-kyran-
dale/
ebookname.com
https://ebookname.com/product/the-healthy-body-handbook-a-total-guide-
to-the-prevention-and-treatment-of-sports-injuries-1st-edition-david-
saidoff/
ebookname.com
The Pursuit of Excellence Through Education 1st Edition
Michel Ferrari
https://ebookname.com/product/the-pursuit-of-excellence-through-
education-1st-edition-michel-ferrari/
ebookname.com
https://ebookname.com/product/not-quite-the-diplomat-home-truths-
about-world-affairs-first-edition-chris-patten/
ebookname.com
https://ebookname.com/product/nothing-to-be-frightened-of-julian-
barnes/
ebookname.com
https://ebookname.com/product/grassroots-coalitions-and-state-policy-
change-organizing-for-immigrant-health-care-1st-edition-margaret-a-
post/
ebookname.com
https://ebookname.com/product/hyperbolic-dynamics-and-brownian-motion-
an-introduction-jacques-franchi/
ebookname.com
Creating Christian Granada Society and Religious Culture
in an Old World Frontier City 1492 1600 1st Edition David
Coleman
https://ebookname.com/product/creating-christian-granada-society-and-
religious-culture-in-an-old-world-frontier-city-1492-1600-1st-edition-
david-coleman/
ebookname.com
Foundations of Data
Science with Python
Foundations of Data Science with Python introduces readers to the fundamentals of data science, includ-
ing data manipulation and visualization, probability, statistics, and dimensionality reduction. This book
is targeted toward engineers and scientists, but it should be readily understandable to anyone who knows
basic calculus and the essentials of computer programming. It uses a computational-first approach to data
science: the reader will learn how to use Python and the associated data-science libraries to visualize,
transform, and model data, as well as how to conduct statistical tests using real data sets. Rather than rely-
ing on obscure formulas that only apply to very specific statistical tests, this book teaches readers how to
perform statistical tests via resampling; this is a simple and general approach to conducting statistical tests
using simulations that draw samples from the data being analyzed. The statistical techniques and tools are
explained and demonstrated using a diverse collection of data sets to conduct statistical tests related to
contemporary topics, from the effects of socioeconomic factors on the spread of the COVID-19 virus to
the impact of state laws on firearms mortality.
This book can be used as an undergraduate textbook for an Introduction to Data Science course or to
provide a more contemporary approach in courses like Engineering Statistics. However, it is also intended
to be accessible to practicing engineers and scientists who need to gain foundational knowledge of data
science.
Key Features:
• Applies a modern, computational approach to working with data
• Uses real data sets to conduct statistical tests that address a diverse set of contemporary issues
• Teaches the fundamentals of some of the most important tools in the Python data-science stack
• Provides a basic, but rigorous, introduction to Probability and its application to Statistics
• Offers an accompanying website that provides a unique set of online, interactive tools to help the
reader learn the material
John M. Shea, PhD is a Professor in the Department of Electrical and Computer Engineering at the Uni-
versity of Florida, where he has taught classes on stochastic methods, data science, and wireless com-
munications for over 20 years. He earned his PhD in Electrical Engineering from Clemson University in
1998 and later received the Outstanding Young Alumni award from the Clemson College of Engineering
and Science. Dr. Shea was co-leader of Team GatorWings, which won the Defense Advanced Research
Project Agency’s (DARPA’s) Spectrum Collaboration Challenge (DARPA’s fifth Grand Challenge) in 2019.
He received the Lifetime Achievement Award for Technical Achievement from the IEEE Military Com-
munications Conference (MILCOM) and is a two-time winner of the Ellersick Award from the IEEE Com-
munications Society for the Best Paper in the Unclassified Program of MILCOM. He has been an editor
for IEEE Transactions on Wireless Communications, IEEE Wireless Communications magazine, and IEEE
Transactions on Vehicular Technology.
Chapman & Hall/CRC
The Python Series
About the Series
Python has been ranked as the most popular programming language, and it is widely used in education and
industry. This book series will offer a wide range of books on Python for students and professionals. Titles
in the series will help users learn the language at an introductory and advanced level, and explore its many
applications in data science, AI, and machine learning. Series titles can also be supplemented with Jupyter
notebooks.
Python Packages
Tomas Beuzen and Tiffany-Anne Timbers
John M. Shea
Designed cover image: © Agnes Shea
MATLAB is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does
not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB
software or related products does not constitute endorsement or sponsorship by The MathWorks of a
particular pedagogical approach or particular use of the MATLAB software.
First edition published 2024
by CRC Press
2385 NW Executive Center Drive, Suite 320, Boca Raton FL 33431
Reasonable efforts have been made to publish reliable data and information, but the author and publisher
cannot assume responsibility for the validity of all materials or the consequences of their use. The authors
and publishers have attempted to trace the copyright holders of all material reproduced in this publica-
tion and apologize to copyright holders if permission to publish in this form has not been obtained. If any
copyright material has not been acknowledged please write and let us know so we may rectify in any future
reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, trans-
mitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter
invented, including photocopying, microfilming, and recording, or in any information storage or retrieval
system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or
contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-
8400. For works that are not available on CCC please contact mpkbookspermissions@tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used
only for identification and explanation without intent to infringe.
DOI: 10.1201/9781003324997
Publisher’s note: This book has been prepared from camera-ready copy provided by the authors.
For Tucker, Charlotte, and Amelia—
Acknowledgments xi
Preface xiii
1 Introduction 1
1.1 Who is this book for? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Why learn data science from this book? . . . . . . . . . . . . . . . . . . . . 1
1.3 What is data science? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 What data science topics does this book cover? . . . . . . . . . . . . . . . . 5
1.5 What data science topics does this book not cover? . . . . . . . . . . . . . 6
1.6 Extremely Brief Introduction to Jupyter and Python . . . . . . . . . . . . . 6
1.7 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Introduction to Probability 77
4.1 Outcomes, Sample Spaces, and Events . . . . . . . . . . . . . . . . . . . . . 77
4.2 Relative Frequencies and Probabilities . . . . . . . . . . . . . . . . . . . . . 78
4.3 Fair Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.4 Axiomatic Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.5 Corollaries to the Axioms of Probability . . . . . . . . . . . . . . . . . . . . 94
4.6 Combinatorics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.7 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
vii
viii Contents
Index 485
Taylor & Francis
Taylor & Francis Group
http://taylorandfrancis.com
Acknowledgments
I want to thank the many people who helped make this book possible.
My love and thanks go to my wife, Jill, for twenty-five years of love and friendship;
this book would not be possible without the wonderful family and home we have created
together. I love that we can enjoy quiet times at home or adventures together all over the
world. This book is better because of your careful editing.
To my children, Tucker, Charlotte, and Amelia: I treasure every moment with you,
whether it is trading funny memes, solving the New York Times crossword puzzle, battling
at Ping Pong, running our family 5Ks, trying to guess the winner of Survivor, reading to-
gether, or just working side-by-side on the couch.
I thank my parents, Larry and Agnes Shea, for their unwavering love and support. Mom,
you are missed every day.
I have been inspired by too many dedicated engineering educators to list them all. I
have to especially thank my Ph.D. advisor, Dr. Michael Pursley, for mentoring me on how
to conduct research, how to teach, and how to write technically. Thank you to Dr. John
Harris, who convinced me to develop the data-science course on which this book is based.
Thank you to Dr. Catia Silva, who was my co-instructor for one of the semesters teaching
the data-science course.
Several students provided feedback on the book, including Caleb Bowyer, Walter Acosta,
Cortland Bailey, Brennan Borchert, Alexander Braun, Patrick Craig, Justin Nagovskiy,
Allison Neil, Michael Russo, Dieter Steinhauser, Phillip Thompson, and Marisa Younger.
xi
Taylor & Francis
Taylor & Francis Group
http://taylorandfrancis.com
Preface
This book is an introduction to the foundations of data science, including loading and
manipulating data, data visualization, statistics, probability, and dimensionality reduction.
This book is targeted toward engineers and scientists, but it should be easily accessible
to anyone who knows basic calculus and the essentials of computer programming. By
leveraging this background knowledge, this book fits a unique niche in the books on data
science and statistics:
• This book applies a modern, computational approach to work with data.
In particular, it uses simulations (an approach called resampling) to answer statistical
questions.
– Many books on statistics (especially those for engineers) teach students how to
answer statistical questions using only analytical approaches that many learners
find difficult to understand. Most learners can easily understand how resampling
works, in contrast to some arcane formula.
• This book uses real data sets and addresses contemporary issues.
– Many statistics books use contrived examples that are small enough to print in
a book and work with using a calculator, but this results in data sets that are
unrealistic and uninteresting. The computational approach used in this book allows
the use of data sets from across the web to conduct statistical tests on topics from
the effects of socioeconomic factors on the spread of the COVID-19 virus to the
impact of state firearm laws on firearm mortality.
• This book provides a basic, but rigorous, introduction to probability and its
application to statistics.
– Some of the other books that use the resampling approach to statistics omit the
mathematical foundations because they are targeted toward a broader audience
who may not have the rigorous mathematical background of engineers and scien-
tists.
xiii
xiv Preface
• This book shows how to work with some of the most important tools in the
Python data-science stack, including:
– NumPy for working with vectors and matrices, as well as many types of numerical
functions,
– SciPy for working with random distributions and conducting statistical tests,
– Pandas for loading, manipulating, and summarizing data,
– Matplotlib for plotting data, and
– scikit-learn for accessing standard data sets and for advanced statistical process-
ing.
• This book was co-written with a book that covers linear algebra and its
application to data science using Python and NumPy.
fdsp.net/intro,
which can also be accessed using this QR code:
Credits: The image at the top of this page is made using the Wee People font made by
ProPublica: https://github.com/propublica/weepeople. Inspired by a Tweet by Matthew
Kay: https://twitter.com/mjskay/status/1519156106588790786.
Other documents randomly have
different content
RGEON M. J. WHITE: Early in 1919, when I first opened Palo Alto, I
made recommendation for the amendment of the Act, so that the
Compensation of a patient might be held until he had completely
recovered, and I see no reason why there is a legal bar to it. I think
Congress can say that Compensation is payable when a man has
completely recovered and is discharged from the hospital. We cannot
undertake to protect the patients from sharks. For instance, we give a
man a pass; he goes down town and spends his money. As long as he has
money in his pocket, he will spend it. I think it would be legal for
Congress to say that Compensation will be payable when the man has
reached maximum hospital treatment or when he is properly
discharged. Otherwise, if a patient has accumulated, say, $160, he starts
a disturbance and you have to give him the money.
NERAL IRELAND: “Your committee has gone over the resolutions that
have been presented, and we find all of them in order, with the
exception of one submitted by Colonel Bratton with reference to
transportation home. We would inform you that there will have to be
legislation to carry out that resolution. We have changed the resolution
to read as follows:
‘That the Director of the U.S. Veterans’ Bureau be requested to
secure legislation so that the expenses of the patient’s
transportation to his bona fide home, when he has been discharged
for disciplinary reasons, be deducted from his compensation, when
compensation is being given, or may be given thereafter.’
As changed, I recommend that the resolution be adopted by the
meeting as read.”
This M o t i o n was seconded, and carried.
R. BURKE: “We will proceed with the afternoon program. The first
subject is “Foreign Relations of the U.S. Veterans’ Bureau in care of ex-
soldiers of the former allied countries.” It will be discussed by Dr. F. D.
Hester of the Veterans’ Bureau”.
IN CARE OF
As I note that the program upon which I have been placed refers to
foreign relations of the U.S. Veterans’ Bureau in care of ex-soldiers of
the formed-allied countries, with your permission I will add to that, the
care of U.S. ex-service men in foreign countries. The care of U.S. ex-
service men in this country has been discussed from every angle, and it
would seem proper that we should also refer to his care in foreign
countries from a medical standpoint, as well as to the care of the allied
ex-service man in this country.
THE LAW As act of Congress, Public 104, Sixty-sixth
PROVIDING FOR Congress, approved December 24, 1919,
THE CARE OF U.S. provides that the Bureau of War Risk
EX-SERVICE MEN
Insurance, now the Veterans’ Bureau, is
IN FOREIGN authorized, to furnish transportation, also
COUNTRIES medical, surgical, and hospital services to
discharged members of the military or naval forces of those
Governments which have been associated in war with the United States
since April 6, 1917, and come within the provisions of laws of such
Governments similar to the War Risk Insurance Act, at such rates and
under such regulations as the Director of the Bureau of War Risk
Insurance may prescribe, etc.
AUTHORIZATION You will note that this provision of the law
FOR SERVICE stipulates at such rates and under such
regulations as the Director of the Bureau of War Risk Insurance may
prescribe. The regulation that has been issued by the Director of the
U.S. Veterans’ Bureau provides that in all cases where application for
treatment is made by ex-members of the military or naval forces of the
allies, such treatment will be furnished only on the specific
authorization of the Director of the U.S. Veterans’ Bureau upon
authority obtained from the Government concerned, to incur the
expense of treatment in each case. When treatment is so authorized, the
same procedure is to be followed as in cases of application made by ex-
members of the Canadian forces, which is as follows:
RECIPROCAL AGREEMENT WITH CANADA:
An agreement entered into between the Canadian and this
Government upon reciprocal lines provides that when an honorably
discharged member of the military or naval forces of the Allies, resident
in the United States or its territorial possessions, requires medical or
surgical treatment for a disability contracted in, due to, or increased by
his military or naval service, he shall apply to the nearest medical
representative of the U.S. Veterans’ Bureau. If such representative is not
available, information regarding the address of the nearest medical
representative of the U.S. Veterans’ Bureau may be secured through any
local representative of the American Red Cross, the American Legion,
the Y.M.C.A., the Salvation Army, the Knights of Columbus, or other
volunteer agency.
METHOD OF PROCEDURE WHEN
APPLICATION IS MADE FOR TREATMENT:
When application for treatment is made by an ex-member of the
Canadian forces, the medical representative of the U.S. Veterans’
Bureau to whom such application is made will communicate with the
District Manager in order to obtain particulars regarding the man’s
military or naval status and medical history, and the District Manager
will communicate with the Bureau (Assistant Director, Medical
Division, Attention Foreign Relations Section), which will obtain from
the Government of Canada the necessary information. If additional
information is required, the District Manager, if speed be necessary, will
request such additional information by telegram. In no case should
treatment be undertaken pending receipt of authority from the U.S.
Veterans’ Bureau, unless the call be one of emergency, and in all
emergency cases the medical officer in the field is authorized to give
prompt service.
LETTER OF INSTRUCTIONS:
The articles of agreement with Canada have been supplemented
with a letter of instructions that clearly sets forth just how service is to
be given by representatives of this Bureau to beneficiaries of the
Canadian Government. This letter of instruction is a guide for the
representatives of this Bureau in the field as to proper procedure when
any doubtful situation should arise, and has been sent to the District
Managers in such numbers as to furnish each medical officer with a
copy.
It is possible that some of you gentlemen are not in possession of
these instructions; should such be the case, a number of copies are at
your disposal here, and may be obtained from the stenographers’ table.
NUMBER OF CANADIAN EX-SERVICE MEN
CARED FOR BY THIS BUREAU:
It may not be out of order to mention at this time that the U.S.
Veterans’ Bureau through its Foreign Relations Section, Medical
Division, has cared for over 9,000 Canadian ex-service men. When I say
Canadian ex-service men, please know that these are not in reality
Canadians, but that 95% of the number are American boys, who,
through their valor and enthusiasm, rushed into the breach in the early
stages of the conflict, having crossed the Canadian border in 1914, 1915,
1916 and 1917. Their Services having been rendered under the English
flag in Canadian organizations, these boys are properly beneficiaries of
the Canadian Government, and are being cared for by that Government
through the U.S. Veterans’ Bureau, Foreign Relations Section, Medical
Division, by cooperation with the Department of Soldiers’ Civil Re-
Establishment, which is an organization of the Canadian Government,
similar to the U. S. Veterans’ Bureau. The personnel of the Department
of Soldiers’ Civil Re-Establishment is something over 6,000, divided
into 10 medical units, or districts. The Foreign Relations Section,
Medical Division, of the Bureau is constantly in receipt of requests for
service from allied ex-service men with whose government this Bureau
has no reciprocal agreement. These cases are promptly referred to the
representative of that government located in Washington with a view of
giving service if the Government under whose flag the man served will
authorize the service.
REPORTS TO BE MADE UPON CANADIAN
FORMS 346,399 and 76.:
Your attention is particularly called to the necessity of forwarding
to the Bureau reports required by the Canadian Government regarding
the hospitalization of Canadian ex-service men; and I desire to stress
this point, that, when a medical examination is made of a Canadian ex-
service man, the report of your findings should be furnished on S. C.R.
Form 346 (S.C.R. meaning Soldiers’ Civil Re-Establishment), this Form
being similar in requirements to the Bureau Medical Division Form
2545. It is upon the findings in this report mode upon S.C.R. 346 that
the Canadian Government gives its approval for hospitalization. S.C.R.
Form 399 is a Progress Report, and should be rendered monthly during
the man’s stay in hospital, for the reason that until this report is
received no pension will be paid to the man or to his dependents. When
a Canadian beneficiary is hospitalized his compensation is reduced, but
the family allowance, should he have dependents, is increased. $40 is
the maximum pension payable to a man while in hospital, $10 of which
is paid to him and $30 held in reserve, which is accumulative, and is
given to him upon discharge from hospital. The family allowance is
increased according to the number of his dependents, and is paid to his
family direct. S.C.R. Form. 76 is a discharge report from hospital and
should be rendered promptly in triplicate, as all these reports should be.
If you are not in possession of these Canadian Forms, 346, 399 and 76,
they may be obtained from the District Manager in whose district you
are located.
EX-MEMBERS OF THE MILITARY AND NAVAL
FORCES OF THE UNITED KINGDOM:
At this time the Veterans’ Bureau has completed agreements
whereby service is being given to British ex-service men, which includes
ex-members of the military and naval forces of the United Kingdom of
Great Britain and Ireland, New Zealand and South Africa, as well as
those of Canada.
RUSSIAN ALLIED EX-SERVICE MEN:
In addition to the above named may be included the Russian allied
ex-service men, an agreement having been entered into with the
Russian Ambassador now located in Washington, whose official status
has not changed since his appointment as a representative of the late
Czar. When medical, surgical, or hospital treatment is requested for a
Russian ex-service man, it must be approved in advance by the Russian
Ambassador, who certifies that any expense incident to this service will
be reimbursed by the Russian Ambassador.
CZECHOSLOVAKIAN EX-SERVICE MEN:
Through an agreement with the Czechoslovakian Minister, this
service is also furnished to the Czechoslovakian allied ex-service men
upon request from the Minister of that country, accompanied by a
statement that any expense incident to service will be reimbursed by his
Government.
RECIPROCAL AGREEMENT WITH THE
BRITISH GOVERNMENT:
An agreement is pending at this time with the British Government
to provide service for all U.S. ex-service men who may be permanently
or temporarily domiciled in the United Kingdom.
CO-OPERATION OF THE STATE DEPARTMENT
IN GIVING SERVICE TO U.S. EX-SERVICE MEN
IN FOREIGN COUNTRIES.:
All medical, surgical, or hospital service that may be required for
U.S. ex-service men now in foreign countries is provided for by this
Bureau through co-operation with representatives abroad of the
Department of State, this Bureau authorizing such service upon receipt
of information that the man is in need of such service, and upon the
establishment of his identity and the fact that the disability for which
treatment is requested was due to or aggravated by his U.S. military
service. Any expense incident to this service is provided for by this
Bureau and is paid for through the State Department by transfer of
appropriation. This procedure has been found very satisfactory, for the
reason that it expedites the service to the man and simplifies the
accounting problem by the prompt payment of any expense that may
have been incurred.
MEDICAL EXAMINATIONS IN FOREIGN
COUNTRIES MADE BY PHYSICIANS
DESIGNATED BY U.S. CONSUL:
For the past six months a ruling has been in effect that where a
Bureau beneficiary in a foreign country was ordered for examination, he
must appear before a physician designated by the U.S. Consul only, and
that unless a report was received within three months from the date of
the letter directing him to appear, or to furnish satisfactory evidence to
the Bureau as to the cause of his inability to report, his compensation, if
he received such, would be held in suspense pending the report of his
medical examination. The result of this procedure in securing an
examination by competent physicians has been that more satisfactory
reports are received.
CHECKS SENT TO BENEFICIARIES IN
FOREIGN COUNTRIES:
The records of the Bureau for the month of December show that at
this time there were 5,977 beneficiaries of the Bureau to whom checks
were sent, totalling in value $489,714. These beneficiaries are resident
in foreign countries located in all parts of the earth, as is shown by the
tabulated statement submitted.
SOME CASES OF INTEREST:
In order that you may have a slight conception of the far-reaching
effect of the strong arm of this Government in giving aid to its ex-service
men wherever located, which means that they are scattered all over the
earth, I believe that it will serve my purpose if I cite a few cases that may
prove of interest to you. I shall with-hold the names of these men and
refer to them by numbers only.
CASE NO. 1:
R. BURKE: stated that in the absence of Major Fraser his subject would be
taken up by Mr. Milliken.
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.
ebookname.com