數字派 NumPy ︰楔子

最近讀了一本十分受用的書

From Python to Numpy

data/cc.large.png data/by.large.png data/sa.large.png data/nc.large.png

 
Latest version – May 2017
data/cubes.png

There are already a fair number of books about Numpy (see Bibliography) and a legitimate question is to wonder if another book is really necessary. As you may have guessed by reading these lines, my personal answer is yes, mostly because I think there is room for a different approach concentrating on the migration from Python to Numpy through vectorization. There are a lot of techniques that you don’t find in books and such techniques are mostly learned through experience. The goal of this book is to explain some of these techniques and to provide an opportunity for making this experience in the process.

Website: http://www.labri.fr/perso/nrougier/from-python-to-numpy

 

心想雖然所寫文本也常引用這個派生程式庫『數字派』

NumPy

NumPy (pronounced /ˈnʌmp/ (NUM-py) or sometimes /ˈnʌmpi/[2][3] (NUM-pee)) is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. The ancestor of NumPy, Numeric, was originally created by Jim Hugunin with contributions from several other developers. In 2005, Travis Oliphantcreated NumPy by incorporating features of the competing Numarray into Numeric, with extensive modifications. NumPy is open-source software and has many contributors.

History

The Python programming language was not initially designed for numerical computing, but attracted the attention of the scientific and engineering community early on, so that a special interest group called matrix-sig was founded in 1995 with the aim of defining an array computing package. Among its members was Python designer and maintainer Guido van Rossum, who implemented extensions to Python’s syntax (in particular the indexing syntax) to make array computing easier.[4]

An implementation of a matrix package was completed by Jim Fulton, then generalized by Jim Hugunin to become Numeric,[4] also variously called Numerical Python extensions or NumPy.[5][6] Hugunin, a graduate student at Massachusetts Institute of Technology (MIT),[6]:10 joined the Corporation for National Research Initiatives (CNRI) to work on JPython in 1997[4] leaving Paul Dubois of Lawrence Livermore National Laboratory (LLNL) to take over as maintainer.[6]:10 Other early contributors include David Ascher, Konrad Hinsen and Travis Oliphant.[6]:10

A new package called Numarray was written as a more flexible replacement for Numeric.[7] Like Numeric, it is now deprecated.[8][9] Numarray had faster operations for large arrays, but was slower than Numeric on small ones,[10] so for a time both packages were used for different use cases. The last version of Numeric v24.2 was released on 11 November 2005 and numarray v1.5.2 was released on 24 August 2006.[11]

There was a desire to get Numeric into the Python standard library, but Guido van Rossum decided that the code was not maintainable in its state then.[when?][12]

In early 2005, NumPy developer Travis Oliphant wanted to unify the community around a single array package and ported Numarray’s features to Numeric, releasing the result as NumPy 1.0 in 2006.[7] This new project was part of SciPy. To avoid installing the large SciPy package just to get an array object, this new package was separated and called NumPy. Support for Python 3 was added in 2011 with NumPy version 1.5.0.[13]

In 2011, PyPy started development on an implementation of the NumPy API for PyPy.[14] It is not yet fully compatible with NumPy.[15]

 

卻是隨手拿來,未曾通盤介紹此一 Python 『數值方法』核心且重要的 package 

Scipy.org

NumPy

 NumPy is the fundamental package for scientific computing with Python. It contains among other things:
  • a powerful N-dimensional array object
  • sophisticated (broadcasting) functions
  • tools for integrating C/C++ and Fortran code
  • useful linear algebra, Fourier transform, and random number capabilities

Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.

NumPy is licensed under the BSD license, enabling reuse with few restrictions.

 

今日逢緣興起,說說『數字派』理念點滴,講講其與『科學派』 SciPy 生態系關係︰

SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering. In particular, these are some of the core packages:

  • numpy

    NumPy

    Base N-dimensional array package

  • scipy

    SciPy library

    Fundamental library for scientific computing

  • matplotlib

    Matplotlib

    Comprehensive 2D Plotting

  • ipython

    IPython

    Enhanced Interactive Console

  • sympy

    Sympy

    Symbolic mathematics

  • pandas badge

    pandas

    Data structures & analysis

1. Getting started with Python for science

This part of the Scipy lecture notes is a self-contained introduction to everything that is needed to use Python for science, from the language itself, to numerical computing or plotting.

……

………

 

願能方便踏腳,特為記。