NumPy 1.6.0 Release Notes¶
This release includes several new features as well as numerous bug fixes and improved documentation. It is backward compatible with the 1.5.0 release, and supports Python 2.4 - 2.7 and 3.1 - 3.2.
Re-introduction of datetime dtype support to deal with dates in arrays.
A new 16-bit floating point type.
A new iterator, which improves performance of many functions.
New 16-bit floating point type¶
This release adds support for the IEEE 754-2008 binary16 format, available as
the data type
numpy.half. Within Python, the type behaves similarly to
float or double, and C extensions can add support for it with the exposed
A new iterator has been added, replacing the functionality of the existing iterator and multi-iterator with a single object and API. This iterator works well with general memory layouts different from C or Fortran contiguous, and handles both standard NumPy and customized broadcasting. The buffering, automatic data type conversion, and optional output parameters, offered by ufuncs but difficult to replicate elsewhere, are now exposed by this iterator.
Legendre, Laguerre, Hermite, HermiteE polynomials in
Extend the number of polynomials available in the polynomial package. In
addition, a new
window attribute has been added to the classes in
order to specify the range the
domain maps to. This is mostly useful
for the Laguerre, Hermite, and HermiteE polynomials whose natural domains
are infinite and provides a more intuitive way to get the correct mapping
of values without playing unnatural tricks with the domain.
Fortran assumed shape array and size function support in
F2py now supports wrapping Fortran 90 routines that use assumed shape arrays. Before such routines could be called from Python but the corresponding Fortran routines received assumed shape arrays as zero length arrays which caused unpredicted results. Thanks to Lorenz Hüdepohl for pointing out the correct way to interface routines with assumed shape arrays.
In addition, f2py supports now automatic wrapping of Fortran routines
that use two argument
size function in dimension specifications.
Other new functions¶
numpy.ravel_multi_index : Converts a multi-index tuple into
an array of flat indices, applying boundary modes to the indices.
numpy.einsum : Evaluate the Einstein summation convention. Using the
Einstein summation convention, many common multi-dimensional array operations
can be represented in a simple fashion. This function provides a way compute
numpy.count_nonzero : Counts the number of non-zero elements in an array.
numpy.min_scalar_type : These functions expose
the underlying type promotion used by the ufuncs and other operations to
determine the types of outputs. These improve upon the
numpy.mintypecode which provide similar functionality but do
not match the ufunc implementation.
default error handling¶
The default error handling has been change from
all except for
underflow, which remains as
Several new compilers are supported for building Numpy: the Portland Group Fortran compiler on OS X, the PathScale compiler suite and the 64-bit Intel C compiler on Linux.
The testing framework gained
numpy.testing.assert_allclose, which provides
a more convenient way to compare floating point arrays than
assert_almost_equal, assert_approx_equal and assert_array_almost_equal.
In addition to the APIs for the new iterator and half data type, a number
of other additions have been made to the C API. The type promotion
mechanism used by ufuncs is exposed via
PyArray_MinScalarType. A new enumeration
NPY_CASTING has been added which controls what types of casts are
permitted. This is used by the new functions
PyArray_CanCastTypeTo. A more flexible way to handle
conversion of arbitrary python objects into arrays is exposed by
The “normed” keyword in
numpy.histogram is deprecated. Its functionality
will be replaced by the new “density” keyword.
The functions refft, refft2, refftn, irefft, irefft2, irefftn, which were aliases for the same functions without the ‘e’ in the name, were removed.
The sync() and close() methods of memmap were removed. Use flush() and “del memmap” instead.
The deprecated functions
numpy.lib.ufunclike.log2 were removed.
Several deprecated items were removed from the
* ``numpy.ma.MaskedArray`` "raw_data" method * ``numpy.ma.MaskedArray`` constructor "flag" keyword * ``numpy.ma.make_mask`` "flag" keyword * ``numpy.ma.allclose`` "fill_value" keyword
numpy.get_numpy_include function was removed, use