ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturers Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the eBook in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a Click here to view code image link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
Foundational
Python for Data
Science
Kennedy R. Behrman
Boston Columbus New York San Francisco Amsterdam Cape Town
Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City
So Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at or (800) 382-3419.
For government sales inquiries, please contact .
For questions about sales outside the U.S., please contact .
Visit us on the Web: informit.com/aw.
Library of Congress Control Number: 2021940284
Copyright 2022 Pearson Education, Inc.
All rights reserved. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearson.com/permissions/.
ISBN-13: 978-0-13-662435-6
ISBN-10: 0-13-662435-9
ScoutAutomatedPrintCode
Editor-in-Chief
Mark Taub
Acquisitions Editor
Malobika Chakraborty
Development Editor
Mark Renfrow
Managing Editor
Sandra Schroeder
Senior Project Editor
Lori Lyons
Copy Editor
Kitty Wilson
Production Manager
Aswini Kumar/codeMantra
Indexer
Timothy Wright
Proofreader
Abigail Manheim
Compositor
codeMantra
This book is dedicated to Tatiana, Itta, and Maple,
who is probably still under the bed.
Preface
The Python language has been around for a long time and worn many hats. Its original implementation was started by Guido van Rossum in 1989 as a tool for system administration as an alternative to Bash scripts and C programs.
I was first introduced to Python working in the film industry, where we used it to automate data management across departments and locations. In the last decade, Python has become a dominant tool in Data Science.
This dominance evolved due to two developments: the Jupyter notebook, and powerful third-party libraries. In 2001 Fernando Perez began the IPython project, an interactive Python environment inspired by Maple and Mathematica notebooks. By 2014, the notebook-specific part of the project was split off as the Jupyter project. These notebooks have excelled for scientific and statistical work environments. In parallel with this development, third-party libraries for scientific and statistical computing were developed for Python. With so many applications, the functionality available to a Python programmer has grown immensely. With specialized packages for everything from opening web sockets to processing natural language text, there is more available than a beginning developer needs.
This project was the brainchild of Noah Gift. In his work as an educator, he found that students of Data Science did not have a resource to learn just the parts of Python they needed. There were many general Python books and books about Data Science, but not resources for learning just the Python needed to get started in Data Science. That is what we have attempted to provide here. This book will not teach the Python needed to set up a web page or perform system administration. It is also not intended to teach you Data Science, but rather the Python needed to learn Data Science.
I hope you will find this guide a good companion in your quest to grow your Data Science knowledge.
Example Code
Most of the code shown in examples in this book can be found on GitHub at:
https://github.com/kbehrman/foundational-python-for-data-science.
Figure Credits
Figure | Credit Attribution |
Cover | Boris Znaev/Shutterstock |
Cover | Mark.G/Shutterstock |
Screenshot of Colab Dialogue 2021 Google |
Screenshot of Renaming Notebook 2021 Google |
Screenshot of Google Drive 2021 Google |
Screenshot of Editing Text Cells 2021 Google |
Screenshot of Formatting Text 2021 Google |
Screenshot of Lists 2021 Google |
Screenshot of Headings 2021 Google |
Screenshot of Table of Contents 2021 Google |
Screenshot of Hiding Cells 2021 Google |
Screenshot of LaTeX Example 2021 Google |
Screenshot of A Files 2021 Google |
Screenshot of Upload Files 2021 Google |
Screenshot of Mount Google Drive 2021 Google |
Screenshot of Code Snippets 2021 Google |