Scientific Computing with Python 3

An example-rich, comprehensive guide for all of your Python computational needs

Scientific Computing with Python 3

Claus Führer, Jan Erik Solem, Olivier Verdier

1 customer reviews
An example-rich, comprehensive guide for all of your Python computational needs
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786463517
Paperback332 pages

Book Description

Python can be used for more than just general-purpose programming. It is a free, open source language and environment that has tremendous potential for use within the domain of scientific computing. This book presents Python in tight connection with mathematical applications and demonstrates how to use various concepts in Python for computing purposes, including examples with the latest version of Python 3. Python is an effective tool to use when coupling scientific computing and mathematics and this book will teach you how to use it for linear algebra, arrays, plotting, iterating, functions, polynomials, and much more.

Table of Contents

Chapter 1: Getting Started
Installation and configuration instructions
Program and program flow
Basic types
Repeating statements with loops
Conditional statements
Encapsulating code with functions
Scripts and modules
Interpreter
Summary
Chapter 2: Variables and Basic Types
Variables
Numeric types
Booleans
Strings
Summary
Exercises
Chapter 3: Container Types
Lists
Arrays
Tuples
Dictionaries
Sets
Container conversions
Type checking
Summary
Exercises
Chapter 4: Linear Algebra – Arrays
Overview of the array type
Mathematical preliminaries
The array type
Accessing array entries
Functions to construct arrays
Accessing and changing the shape
Stacking
Functions acting on arrays
Linear algebra methods in SciPy
Summary
Exercises
Chapter 5: Advanced Array Concepts
Array views and copies
Comparing arrays
Boolean operations on arrays
Array indexing
Performance and Vectorization
Broadcasting
Sparse matrices
Summary
Chapter 6: Plotting
Basic plotting
Formatting
Meshgrid and contours
Images and contours
Matplotlib objects
Making 3D plots
Making movies from plots
Summary
Exercises
Chapter 7: Functions
Basics
Parameters and arguments
Variable number of arguments
Return values
Recursive functions
Function documentation
Functions are objects
Anonymous functions - the  lambda keyword
Functions as decorators
Summary
Exercises
Chapter 8: Classes
Introduction to classes
Attributes and methods
Attributes that depend on each other
Bound and unbound methods
Class attributes
Class methods
Subclassing and inheritance
Encapsulation
Classes as decorators
Summary
Exercises
Chapter 9: Iterating
The for statement
Controlling the flow inside the loop
Iterators
Convergence acceleration
List filling patterns
When iterators behave as lists
Iterator objects
Infinite iterations
Summary
Exercises
Chapter 10: Error Handling
What are exceptions?
Finding Errors: Debugging
Summary
Chapter 11: Namespaces, Scopes, and Modules
Namespace
Scope of a variable
Modules
Summary
Chapter 12: Input and Output
File handling
NumPy methods
Pickling
Shelves
Reading and writing Matlab data files
Reading and writing images
Summary
Chapter 13: Testing
Manual testing
Automatic testing
Using unittest package
Parameterizing tests
Assertion tools
Float comparisons
Unit and functional tests
Debugging
Test discovery
Measuring execution time
Summary
Exercises
Chapter 14: Comprehensive Examples
Polynomials
The polynomial class
Newton polynomial
Spectral clustering
Solving initial value problems
Summary
Exercises
Chapter 15: Symbolic Computations - SymPy
What are symbolic computations?
Basic elements of SymPy
Elementary Functions
Symbolic Linear Algebra
Examples for Linear Algebra Methods in SymPy
Substitutions
Evaluating symbolic expressions
Converting a symbolic expression into a numeric function
Summary

What You Will Learn

  • The principal syntactical elements of Python
  • The most important and basic types in Python
  • The essential building blocks of computational mathematics, linear algebra, and related Python objects
  • Plot in Python using matplotlib to create high quality figures and graphics to draw and visualize your results
  • Define and use functions and learn to treat them as objects
  • How and when to correctly apply object-oriented programming for scientific computing in Python
  • Handle exceptions, which are an important part of writing reliable and usable code
  • Two aspects of testing for scientific programming: Manual and Automatic

Authors

Table of Contents

Chapter 1: Getting Started
Installation and configuration instructions
Program and program flow
Basic types
Repeating statements with loops
Conditional statements
Encapsulating code with functions
Scripts and modules
Interpreter
Summary
Chapter 2: Variables and Basic Types
Variables
Numeric types
Booleans
Strings
Summary
Exercises
Chapter 3: Container Types
Lists
Arrays
Tuples
Dictionaries
Sets
Container conversions
Type checking
Summary
Exercises
Chapter 4: Linear Algebra – Arrays
Overview of the array type
Mathematical preliminaries
The array type
Accessing array entries
Functions to construct arrays
Accessing and changing the shape
Stacking
Functions acting on arrays
Linear algebra methods in SciPy
Summary
Exercises
Chapter 5: Advanced Array Concepts
Array views and copies
Comparing arrays
Boolean operations on arrays
Array indexing
Performance and Vectorization
Broadcasting
Sparse matrices
Summary
Chapter 6: Plotting
Basic plotting
Formatting
Meshgrid and contours
Images and contours
Matplotlib objects
Making 3D plots
Making movies from plots
Summary
Exercises
Chapter 7: Functions
Basics
Parameters and arguments
Variable number of arguments
Return values
Recursive functions
Function documentation
Functions are objects
Anonymous functions - the  lambda keyword
Functions as decorators
Summary
Exercises
Chapter 8: Classes
Introduction to classes
Attributes and methods
Attributes that depend on each other
Bound and unbound methods
Class attributes
Class methods
Subclassing and inheritance
Encapsulation
Classes as decorators
Summary
Exercises
Chapter 9: Iterating
The for statement
Controlling the flow inside the loop
Iterators
Convergence acceleration
List filling patterns
When iterators behave as lists
Iterator objects
Infinite iterations
Summary
Exercises
Chapter 10: Error Handling
What are exceptions?
Finding Errors: Debugging
Summary
Chapter 11: Namespaces, Scopes, and Modules
Namespace
Scope of a variable
Modules
Summary
Chapter 12: Input and Output
File handling
NumPy methods
Pickling
Shelves
Reading and writing Matlab data files
Reading and writing images
Summary
Chapter 13: Testing
Manual testing
Automatic testing
Using unittest package
Parameterizing tests
Assertion tools
Float comparisons
Unit and functional tests
Debugging
Test discovery
Measuring execution time
Summary
Exercises
Chapter 14: Comprehensive Examples
Polynomials
The polynomial class
Newton polynomial
Spectral clustering
Solving initial value problems
Summary
Exercises
Chapter 15: Symbolic Computations - SymPy
What are symbolic computations?
Basic elements of SymPy
Elementary Functions
Symbolic Linear Algebra
Examples for Linear Algebra Methods in SymPy
Substitutions
Evaluating symbolic expressions
Converting a symbolic expression into a numeric function
Summary

Book Details

ISBN 139781786463517
Paperback332 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Modern Python Cookbook Book Cover
Modern Python Cookbook
$ 39.99
$ 28.00
Practical Data Science Cookbook Book Cover
Practical Data Science Cookbook
$ 29.99
$ 21.00
Mastering Python Book Cover
Mastering Python
$ 31.99
$ 22.40
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Getting Started with Ansible 2 Security Automation [Video] Book Cover
Getting Started with Ansible 2 Security Automation [Video]
$ 124.99
$ 106.25