Book Image

NumPy Cookbook - Second Edition

By : Ivan Idris
Book Image

NumPy Cookbook - Second Edition

By: Ivan Idris

Overview of this book

<p>NumPy has the ability to give you speed and high productivity. High performance calculations can be done easily with clean and efficient code, and it allows you to execute complex algebraic and mathematical computations in no time.</p> <p>This book will give you a solid foundation in NumPy arrays and universal functions. Starting with the installation and configuration of IPython, you'll learn about advanced indexing and array concepts along with commonly used yet effective functions. You will then cover practical concepts such as image processing, special arrays, and universal functions. You will also learn about plotting with Matplotlib and the related SciPy project with the help of examples. At the end of the book, you will study how to explore atmospheric pressure and its related techniques. By the time you finish this book, you'll be able to write clean and fast code with NumPy.</p>
Table of Contents (19 chapters)
NumPy Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Cython


In order to use Cython, we need to install it. The Enthought Canopy, Anaconda, and Sage distributions include Cython. For more information, see https://www.enthought.com/products/canopy/, https://store.continuum.io/cshop/anaconda/, and http://sagemath.org/. We will not discuss here how to install these distributions. Obviously, we need a C compiler to compile the generated C code. On some operating systems such as Linux, the compiler will already be present. In this recipe, we will assume that you already have the compiler installed.

How to do it...

We can install Cython using any of the following methods:

  • Install Cython from a source archive by performing the following steps:

    • Download a source archive from http://cython.org/#download.

    • Unpack it.

    • Browse to the directory using the cd command.

    • Run the following command:

      $ python setup.py install
      
  • Install Cython from the PyPI repository with any one of these commands:

    $ easy_install cython
    $ sudo pip install cython
    
  • Install Cython on...