python_data_science_handbook.pdf

(16762 KB) Pobierz
Python
Data Science
Handbook
ESSENTIAL TOOLS FOR WORKING WITH DATA
powered by
Jake VanderPlas
Python Data Science Handbook
Essential Tools for Working with Data
Jake VanderPlas
Beijing
Boston Farnham Sebastopol
Tokyo
Python Data Science Handbook
by Jake VanderPlas
Copyright © 2017 Jake VanderPlas. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/insti‐
tutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editor:
Dawn Schanafelt
Production Editor:
Kristen Brown
Copyeditor:
Jasmine Kwityn
Proofreader:
Rachel Monaghan
December 2016:
First Edition
Indexer:
WordCo Indexing Services, Inc.
Interior Designer:
David Futato
Cover Designer:
Karen Montgomery
Illustrator:
Rebecca Demarest
Revision History for the First Edition
2016-11-17:
First Release
See
http://oreilly.com/catalog/errata.csp?isbn=9781491912058
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.
Python Data Science Handbook,
the
cover image, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-91205-8
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1.
IPython: Beyond Normal Python. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Shell or Notebook?
Launching the IPython Shell
Launching the Jupyter Notebook
Help and Documentation in IPython
Accessing Documentation with ?
Accessing Source Code with ??
Exploring Modules with Tab Completion
Keyboard Shortcuts in the IPython Shell
Navigation Shortcuts
Text Entry Shortcuts
Command History Shortcuts
Miscellaneous Shortcuts
IPython Magic Commands
Pasting Code Blocks: %paste and %cpaste
Running External Code: %run
Timing Code Execution: %timeit
Help on Magic Functions: ?, %magic, and %lsmagic
Input and Output History
IPython’s In and Out Objects
Underscore Shortcuts and Previous Outputs
Suppressing Output
Related Magic Commands
IPython and Shell Commands
Quick Introduction to the Shell
Shell Commands in IPython
2
2
2
3
3
5
6
8
8
9
9
10
10
11
12
12
13
13
13
15
15
16
16
16
18
iii
Zgłoś jeśli naruszono regulamin