Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Jake VanderPlas
A Whirlwind Tour of Python
A Whirlwind Tour of Python
Introduction
Using Code Examples
Installation and Practical Considerations
The Zen of Python
How to Run Python Code
A Quick Tour of Python Language Syntax
Comments Are Marked by #
End-of-Line Terminates a Statement
Semicolon Can Optionally Terminate a Statement
Indentation: Whitespace Matters!
Whitespace Within Lines Does Not Matter
Parentheses Are for Grouping or Calling
Finishing Up and Learning More
Basic Python Semantics: Variables and Objects
Python Variables Are Pointers
Everything Is an Object
Basic Python Semantics: Operators
Arithmetic Operations
Bitwise Operations
Assignment Operations
Comparison Operations
Boolean Operations
Identity and Membership Operators
Built-In Types: Simple Values
Integers
Floating-Point Numbers
Complex Numbers
String Type
None Type
Boolean Type
Built-In Data Structures
Lists
Tuples
Dictionaries
Sets
More Specialized Data Structures
Control Flow
Conditional Statements: if, elif, and else
for loops
while loops
break and continue: Fine-Tuning Your Loops
Loops with an else Block
Defining and Using Functions
Using Functions
Defining Functions
Default Argument Values
*args and **kwargs: Flexible Arguments
Anonymous (lambda) Functions
Errors and Exceptions
Runtime Errors
Catching Exceptions: try and except
Raising Exceptions: raise
Diving Deeper into Exceptions
try…except…else…finally
Iterators
Iterating over lists
range(): A List Is Not Always a List
Useful Iterators
Specialized Iterators: itertools
List Comprehensions
Basic List Comprehensions
Multiple Iteration
Conditionals on the Iterator
Conditionals on the Value
Generators
Generator Expressions
Generator Functions: Using yield
Example: Prime Number Generator
Modules and Packages
Loading Modules: the import Statement
Importing from Python’s Standard Library
Importing from Third-Party Modules
String Manipulation and Regular Expressions
Simple String Manipulation in Python
Format Strings
Flexible Pattern Matching with Regular Expressions
A Preview of Data Science Tools
NumPy: Numerical Python
Pandas: Labeled Column-Oriented Data
Matplotlib: MATLAB-style scientific visualization
SciPy: Scientific Python
Other Data Science Packages
Resources for Further Learning
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Additional Resources
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset