Sunday, March 9, 2014

Python Study Note: Numpy & Scipy

    In my daily work, I always need to import two modules: NumPy and SciPy. It feels really weird to seems "use" them everyday but without really "understand" them. In this post, I would like to learn and document what is the essential of NumPy and SciPy.

   The introduction in SciPy official website is quite helpful, and I simply copy it here for my reference.

    "NumPy‘s array type augments the Python language with an efficient data structure useful for numerical work, e.g., manipulating matrices. NumPy also provides basic numerical routines, such as tools for finding eigenvectors.
    SciPy contains additional routines needed in scientific work: for example, routines for computing integrals numerically, solving differential equations, optimization, and sparse matrices."

    Looks like NumPy provide an important data structure (array) and related operations, and SciPy contain additional tools for mathematically heavy calculations. Due to my own interest, I want to focus on NumPy for its data structure in following discussions.


1. Basic Structure
    NumPy's main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers. In Numpy dimensions are called axes. The number of axes is rank.

There are several operations on the NumPy array, they are: creation, self-operation, inter-operation, and and math-rich operations. Will write in following post.


No comments:

Post a Comment