Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The math libraries


The Python library has six modules relevant to mathematical work. These are described in Chapter 9, Numeric and Mathematical Modules, of the Python Standard Library document. Beyond this, we have external libraries such as NumPy (http://www.numpy.org) and SciPy (http://www.scipy.org). These libraries include vast collections of sophisticated algorithms. For an even more sophisticated toolset, the Anaconda project (https://store.continuum.io/cshop/anaconda/) combines NumPy, SciPy, and 18 more packages.

These are the relevant built-in numeric packages:

  • numbers: This module defines the essential numeric abstractions. We rarely need this unless we're going to invent an entirely new kind of number.

  • math: This module has a large collection of functions. It includes basic sqrt(), the various trigonometric functions (sine, cosine, and so on) and the various log-related functions. It has functions for working with the internals of floating-point numbers. It also has the gamma function...