Release Notes¶
- 1.19.0
- Highlights
- Expired deprecations
- Compatibility notes
- Changed random variate stream from
numpy.random.Generator.dirichlet
- Scalar promotion in
PyArray_ConvertToCommonType
- Fasttake and fastputmask slots are deprecated and NULL’ed
np.ediff1d
casting behaviour withto_end
andto_begin
- Converting of empty array-like objects to NumPy arrays
- Removed
multiarray.int_asbuffer
numpy.distutils.compat
has been removedissubdtype
no longer interpretsfloat
asnp.floating
- Change output of
round
on scalars to be consistent with Python - The
numpy.ndarray
constructor no longer interpretsstrides=()
asstrides=None
- C-Level string to datetime casts changed
SeedSequence
with small seeds no longer conflicts with spawning
- Changed random variate stream from
- Deprecations
- Deprecate automatic
dtype=object
for ragged input - Passing
shape=0
to factory functions innumpy.rec
is deprecated - Deprecation of probably unused C-API functions
- Converting certain types to dtypes is Deprecated
- Deprecation of
round
fornp.complexfloating
scalars numpy.ndarray.tostring()
is deprecated in favor oftobytes()
- Deprecate automatic
- C API changes
- New Features
- Improvements
- Improve detection of CPU features
- Changes
- 1.18.4
- 1.18.3
- 1.18.2
- 1.18.1
- 1.18.0
- Highlights
- New functions
- Deprecations
- Expired deprecations
- Compatibility notes
numpy.lib.recfunctions.drop_fields
can no longer return Nonenumpy.argmin/argmax/min/max
returnsNaT
if it exists in arraynp.can_cast(np.uint64, np.timedelta64, casting='safe')
is nowFalse
- Changed random variate stream from
numpy.random.Generator.integers
- Add more ufunc loops for
datetime64
,timedelta64
- Moved modules in
numpy.random
- C API changes
- New Features
- Improvements
- Different C numeric types of the same size have unique names
argwhere
now produces a consistent result on 0d arrays- Add
axis
argument forrandom.permutation
andrandom.shuffle
method
keyword argument fornp.random.multivariate_normal
- Add complex number support for
numpy.fromstring
numpy.unique
has consistent axes order whenaxis
is not Nonenumpy.matmul
with boolean output now converts to boolean valuesnumpy.random.randint
produced incorrect value when the range was2**32
- Add complex number support for
numpy.fromfile
std=c99
added if compiler is namedgcc
- Changes
NaT
now sorts to the end of arrays- Incorrect
threshold
innp.set_printoptions
raisesTypeError
orValueError
- Warn when saving a dtype with metadata
numpy.distutils
append behavior changed for LDFLAGS and similar- Remove
numpy.random.entropy
without a deprecation - Add options to quiet build configuration and build with
-Werror
- 1.17.5
- 1.17.4
- 1.17.3
- 1.17.2
- 1.17.1
- 1.17.0
- Highlights
- New functions
- Deprecations
- Future Changes
- Compatibility notes
float16
subnormal rounding- Signed zero when using divmod
MaskedArray.mask
now returns a view of the mask, not the mask itself- Do not lookup
__buffer__
attribute innumpy.frombuffer
out
is buffered for memory overlaps intake
,choose
,put
- Unpickling while loading requires explicit opt-in
- Potential changes to the random stream in old random module
i0
now always returns a result with the same shape as the inputcan_cast
no longer assumes all unsafe casting is allowedndarray.flags.writeable
can be switched to true slightly more often
- C API changes
- New Features
- New extensible
numpy.random
module with selectable random number generators - libFLAME
- User-defined BLAS detection order
- User-defined LAPACK detection order
ufunc.reduce
and related functions now accept awhere
mask- Timsort and radix sort have replaced mergesort for stable sorting
packbits
andunpackbits
accept anorder
keywordunpackbits
now accepts acount
parameterlinalg.svd
andlinalg.pinv
can be faster on hermitian inputs- divmod operation is now supported for two
timedelta64
operands fromfile
now takes anoffset
argument- New mode “empty” for
pad
empty_like
and related functions now accept ashape
argument- Floating point scalars implement
as_integer_ratio
to match the builtin float - Structured
dtype
objects can be indexed with multiple fields names .npy
files support unicode field names
- New extensible
- Improvements
- Array comparison assertions include maximum differences
- Replacement of the fftpack based
fft
module by the pocketfft library - Further improvements to
ctypes
support innumpy.ctypeslib
numpy.errstate
is now also a function decoratornumpy.exp
andnumpy.log
speed up for float32 implementation- Improve performance of
numpy.pad
numpy.interp
handles infinities more robustly- Pathlib support for
fromfile
, tofile andndarray.dump
- Specialized
isnan
,isinf
, andisfinite
ufuncs for bool and int types isfinite
supportsdatetime64
andtimedelta64
types- New keywords added to
nan_to_num
- MemoryErrors caused by allocated overly large arrays are more descriptive
floor
,ceil
, andtrunc
now respect builtin magic methodsquantile
now works on fraction.Fraction anddecimal.Decimal
objects- Support of object arrays in
matmul
- Changes
median
andpercentile
family of functions no longer warn aboutnan
timedelta64 % 0
behavior adjusted to returnNaT
- NumPy functions now always support overrides with
__array_function__
lib.recfunctions.structured_to_unstructured
does not squeeze single-field viewsclip
now uses a ufunc under the hood__array_interface__
offset now works as documented- Pickle protocol in
savez
set to 3 forforce zip64
flag - Structured arrays indexed with non-existent fields raise
KeyError
notValueError
- 1.16.6
- 1.16.5
- 1.16.4
- 1.16.3
- 1.16.2
- 1.16.1
- 1.16.0
- Highlights
- New functions
- New deprecations
- Expired deprecations
- Future changes
- Compatibility notes
- C API changes
- New Features
- Improvements
- no-copy pickling of numpy arrays
- build shell independence
- np.polynomial.Polynomial classes render in LaTeX in Jupyter notebooks
randint
andchoice
now work on empty distributionslinalg.lstsq
,linalg.qr
, andlinalg.svd
now work with empty arrays- Chain exceptions to give better error messages for invalid PEP3118 format strings
- Einsum optimization path updates and efficiency improvements
numpy.angle
andnumpy.expand_dims
now work onndarray
subclassesNPY_NO_DEPRECATED_API
compiler warning suppressionnp.diff
Added kwargs prepend and append- ARM support updated
- Appending to build flags
- Generalized ufunc signatures now allow fixed-size dimensions
- Generalized ufunc signatures now allow flexible dimensions
np.clip
and theclip
method check for memory overlap- New value
unscaled
for optioncov
innp.polyfit
- Detailed docstrings for scalar numeric types
__module__
attribute now points to public modules- Large allocations marked as suitable for transparent hugepages
- Alpine Linux (and other musl c library distros) support
- Speedup
np.block
for large arrays - Speedup
np.take
for read-only arrays - Support path-like objects for more functions
- Better behaviour of ufunc identities during reductions
- Improved conversion from ctypes objects
- A new
ndpointer.contents
member matmul
is now aufunc
- Start and stop arrays for
linspace
,logspace
andgeomspace
- CI extended with additional services
- Changes
- Comparison ufuncs will now error rather than return NotImplemented
- Positive will now raise a deprecation warning for non-numerical arrays
NDArrayOperatorsMixin
now implements matrix multiplication- The scaling of the covariance matrix in
np.polyfit
is different maximum
andminimum
no longer emit warnings- Umath and multiarray c-extension modules merged into a single module
getfield
validity checks extended- NumPy functions now support overrides with
__array_function__
- Arrays based off readonly buffers cannot be set
writeable
- 1.15.4
- 1.15.3
- 1.15.2
- 1.15.1
- 1.15.0
- Highlights
- New functions
- Deprecations
- Future Changes
- Compatibility notes
- Compiled testing modules renamed and made private
- The
NpzFile
returned bynp.savez
is now acollections.abc.Mapping
- Under certain conditions,
nditer
must be used in a context manager - Numpy has switched to using pytest instead of nose for testing
- Numpy no longer monkey-patches
ctypes
with__array_interface__
np.ma.notmasked_contiguous
andnp.ma.flatnotmasked_contiguous
always return listsnp.squeeze
restores old behavior of objects that cannot handle anaxis
argument- unstructured void array’s
.item
method now returns a bytes object copy.copy
andcopy.deepcopy
no longer turnmasked
into an array- Multifield Indexing of Structured Arrays will still return a copy
- C API changes
- New Features
- Improvements
np.einsum
updatesnp.ufunc.reduce
and related functions now accept an initial valuenp.flip
can operate over multiple axeshistogram
andhistogramdd
functions have moved tonp.lib.histograms
histogram
will accept NaN values when explicit bins are givenhistogram
works on datetime types, when explicit bin edges are givenhistogram
“auto” estimator handles limited variance better- The edges retuned by histogram` and
histogramdd
now match the data float type histogramdd
allows explicit ranges to be given in a subset of axes- The normed arguments of
histogramdd
andhistogram2d
have been renamed np.r_
works with 0d arrays, andnp.ma.mr_
works withnp.ma.masked
np.ptp
accepts akeepdims
argument, and extended axis tuplesMaskedArray.astype
now is identical tondarray.astype
- Enable AVX2/AVX512 at compile time
nan_to_num
always returns scalars when receiving scalar or 0d inputsnp.flatnonzero
works on numpy-convertible typesnp.interp
returns numpy scalars rather than builtin scalars- Allow dtype field names to be unicode in Python 2
- Comparison ufuncs accept
dtype=object
, overriding the defaultbool
sort
functions acceptkind='stable'
- Do not make temporary copies for in-place accumulation
linalg.matrix_power
can now handle stacks of matrices- Increased performance in
random.permutation
for multidimensional arrays - Generalized ufuncs now accept
axes
,axis
andkeepdims
arguments - float128 values now print correctly on ppc systems
- New
np.take_along_axis
andnp.put_along_axis
functions
- 1.14.6
- 1.14.5
- 1.14.4
- 1.14.3
- 1.14.2
- 1.14.1
- 1.14.0
- Highlights
- New functions
- Deprecations
- Future Changes
- Compatibility notes
- The mask of a masked array view is also a view rather than a copy
np.ma.masked
is no longer writeablenp.ma
functions producingfill_value
s have changeda.flat.__array__()
returns non-writeable arrays whena
is non-contiguousnp.tensordot
now returns zero array when contracting over 0-length dimensionnumpy.testing
reorganizednp.asfarray
no longer accepts non-dtypes through thedtype
argument- 1D
np.linalg.norm
preserves float input types, even for arbitrary orders count_nonzero(arr, axis=())
now counts over no axes, not all axes__init__.py
files added to test directories.astype(bool)
on unstructured void arrays now callsbool
on each elementMaskedArray.squeeze
never returnsnp.ma.masked
- Renamed first parameter of
can_cast
fromfrom
tofrom_
isnat
raisesTypeError
when passed wrong typedtype.__getitem__
raisesTypeError
when passed wrong type- User-defined types now need to implement
__str__
and__repr__
- Many changes to array printing, disableable with the new “legacy” printing mode
- C API changes
- New Features
- Encoding argument for text IO functions
- External
nose
plugins are usable bynumpy.testing.Tester
parametrize
decorator added tonumpy.testing
chebinterpolate
function added tonumpy.polynomial.chebyshev
- Support for reading lzma compressed text files in Python 3
sign
option added tonp.setprintoptions
andnp.array2string
hermitian
option added to``np.linalg.matrix_rank``threshold
andedgeitems
options added tonp.array2string
concatenate
andstack
gained anout
argument- Support for PGI flang compiler on Windows
- Improvements
- Numerator degrees of freedom in
random.noncentral_f
need only be positive. - The GIL is released for all
np.einsum
variations - The np.einsum function will use BLAS when possible and optimize by default
f2py
now handles arrays of dimension 0numpy.distutils
supports using MSVC and mingw64-gfortran togethernp.linalg.pinv
now works on stacked matricesnumpy.save
aligns data to 64 bytes instead of 16- NPZ files now can be written without using temporary files
- Better support for empty structured and string types
- Support for
decimal.Decimal
innp.lib.financial
- Float printing now uses “dragon4” algorithm for shortest decimal representation
void
datatype elements are now printed in hex notation- printing style for
void
datatypes is now independently customizable - Reduced memory usage of
np.loadtxt
- Numerator degrees of freedom in
- Changes
- Multiple-field indexing/assignment of structured arrays
- Integer and Void scalars are now unaffected by
np.set_string_function
- 0d array printing changed,
style
arg of array2string deprecated - Seeding
RandomState
using an array requires a 1-d array MaskedArray
objects show a more usefulrepr
- The
repr
ofnp.polynomial
classes is more explicit
- 1.13.3
- 1.13.2
- 1.13.1
- 1.13.0
- Highlights
- New functions
- Deprecations
- Future Changes
- Build System Changes
- Compatibility notes
- C API changes
- New Features
__array_ufunc__
added- New
positive
ufunc - New
divmod
ufunc np.isnat
ufunc tests for NaT special datetime and timedelta valuesnp.heaviside
ufunc computes the Heaviside functionnp.block
function for creating blocked arraysisin
function, improving onin1d
- Temporary elision
axes
argument forunique
np.gradient
now supports unevenly spaced data- Support for returning arrays of arbitrary dimensions in
apply_along_axis
.ndim
property added todtype
to complement.shape
- Support for tracemalloc in Python 3.6
- NumPy may be built with relaxed stride checking debugging
- Improvements
- Ufunc behavior for overlapping inputs
- Partial support for 64-bit f2py extensions with MinGW
- Performance improvements for
packbits
andunpackbits
- Fix for PPC long double floating point information
- Better default repr for
ndarray
subclasses - More reliable comparisons of masked arrays
- np.matrix with booleans elements can now be created using the string syntax
- More
linalg
operations now accept empty vectors and matrices - Bundled version of LAPACK is now 3.2.2
reduce
ofnp.hypot.reduce
andnp.logical_xor
allowed in more cases- Better
repr
of object arrays
- Changes
argsort
on masked arrays takes the same default arguments assort
average
now preserves subclassesarray == None
andarray != None
do element-wise comparisonnp.equal, np.not_equal
for object arrays ignores object identity- Boolean indexing changes
np.random.multivariate_normal
behavior with bad covariance matrixassert_array_less
comparesnp.inf
and-np.inf
nowassert_array_
and masked arraysassert_equal
hide less warningsoffset
attribute value inmemmap
objectsnp.real
andnp.imag
return scalars for scalar inputs- The polynomial convenience classes cannot be passed to ufuncs
- Output arguments to ufuncs can be tuples also for ufunc methods
- 1.12.1
- 1.12.0
- Highlights
- Dropped Support
- Added Support
- Build System Changes
- Deprecations
- Future Changes
- Compatibility notes
- DeprecationWarning to error
- FutureWarning to changed behavior
power
and**
raise errors for integer to negative integer powers- Relaxed stride checking is the default
- The
np.percentile
‘midpoint’ interpolation method fixed for exact indices keepdims
kwarg is passed through to user-class methodsbitwise_and
identity changed- ma.median warns and returns nan when unmasked invalid values are encountered
- Greater consistency in
assert_almost_equal
NoseTester
behaviour of warnings during testingassert_warns
anddeprecated
decorator more specific- C API
- New Features
- Writeable keyword argument for
as_strided
axes
keyword argument forrot90
- Generalized
flip
- BLIS support in
numpy.distutils
- Hook in
numpy/__init__.py
to run distribution-specific checks - New nanfunctions
nancumsum
andnancumprod
added np.interp
can now interpolate complex values- New polynomial evaluation function
polyvalfromroots
added - New array creation function
geomspace
added - New context manager for testing warnings
- New masked array functions
ma.convolve
andma.correlate
added - New
float_power
ufunc np.loadtxt
now supports a single integer asusecol
argument- Improved automated bin estimators for
histogram
np.roll
can now roll multiple axes at the same time- The
__complex__
method has been implemented for the ndarrays pathlib.Path
objects now supported- New
bits
attribute fornp.finfo
- New
signature
argument tonp.vectorize
- Emit py3kwarnings for division of integer arrays
- numpy.sctypes now includes bytes on Python3 too
- Writeable keyword argument for
- Improvements
bitwise_and
identity changed- Generalized Ufuncs will now unlock the GIL
- Caches in np.fft are now bounded in total size and item count
- Improved handling of zero-width string/unicode dtypes
- Integer ufuncs vectorized with AVX2
- Order of operations optimization in
np.einsum
- quicksort has been changed to an introsort
ediff1d
improved performance and subclass handling- Improved precision of
ndarray.mean
for float16 arrays
- Changes
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- Highlights
- Build System Changes
- Future Changes
- Compatibility notes
- New Features
- Improvements
np.gradient
now supports anaxis
argumentnp.lexsort
now supports arrays with object data-typenp.ma.core.MaskedArray
now supports anorder
argument- Memory and speed improvements for masked arrays
ndarray.tofile
now uses fallocate on linux- Optimizations for operations of the form
A.T @ A
andA @ A.T
np.testing.assert_warns
can now be used as a context manager- Speed improvement for np.random.shuffle
- Changes
- Deprecations
- FutureWarnings
- 1.10.4
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- Highlights
- Dropped Support
- Future Changes
- Compatibility notes
- Default casting rule change
- numpy version string
- relaxed stride checking
- Concatenation of 1d arrays along any but
axis=0
raisesIndexError
- np.ravel, np.diagonal and np.diag now preserve subtypes
- rollaxis and swapaxes always return a view
- nonzero now returns base ndarrays
- C API
- recarray field return types
- recarray views
- ‘out’ keyword argument of ufuncs now accepts tuples of arrays
- byte-array indices now raises an IndexError
- Masked arrays containing objects with arrays
- Median warns and returns nan when invalid values are encountered
- Functions available from numpy.ma.testutils have changed
- New Features
- Reading extra flags from site.cfg
- np.cbrt to compute cube root for real floats
- numpy.distutils now allows parallel compilation
- genfromtxt has a new
max_rows
argument - New function np.broadcast_to for invoking array broadcasting
- New context manager clear_and_catch_warnings for testing warnings
- cov has new
fweights
andaweights
arguments - Support for the ‘@’ operator in Python 3.5+
- New argument
norm
to fft functions
- Improvements
- np.digitize using binary search
- np.poly now casts integer inputs to float
- np.interp can now be used with periodic functions
- np.pad supports more input types for
pad_width
andconstant_values
- np.argmax and np.argmin now support an
out
argument - More system C99 complex functions detected and used
- np.loadtxt support for the strings produced by the
float.hex
method - np.isclose properly handles minimal values of integer dtypes
- np.allclose uses np.isclose internally.
- np.genfromtxt now handles large integers correctly
- np.load, np.save have pickle backward compatibility flags
- MaskedArray support for more complicated base classes
- Changes
- Deprecations
- 1.9.2
- 1.9.1
- 1.9.0
- Highlights
- Dropped Support
- Future Changes
- Compatibility notes
- The diagonal and diag functions return readonly views.
- Special scalar float values don’t cause upcast to double anymore
- Percentile output changes
- ndarray.tofile exception type
- Invalid fill value exceptions
- Polynomial Classes no longer derived from PolyBase
- Using numpy.random.binomial may change the RNG state vs. numpy < 1.9
- Random seed enforced to be a 32 bit unsigned integer
- Argmin and argmax out argument
- Einsum
- Indexing
- Non-integer reduction axis indexes are deprecated
promote_types
and string dtypecan_cast
and string dtype- astype and string dtype
- npyio.recfromcsv keyword arguments change
- The
doc/swig
directory moved - The
npy_3kcompat.h
header changed - Negative indices in C-Api
sq_item
andsq_ass_item
sequence methods - NDIter
zeros_like
for string dtypes now returns empty strings
- New Features
- Percentile supports more interpolation options
- Generalized axis support for median and percentile
- Dtype parameter added to
np.linspace
andnp.logspace
- More general
np.triu
andnp.tril
broadcasting tobytes
alias fortostring
method- Build system
- Compatibility to python
numbers
module increasing
parameter added tonp.vander
unique_counts
parameter added tonp.unique
- Support for median and percentile in nanfunctions
- NumpyVersion class added
- Allow saving arrays with large number of named columns
- Full broadcasting support for
np.cross
- Improvements
- Better numerical stability for sum in some cases
- Percentile implemented in terms of
np.partition
- Performance improvement for
np.array
- Performance improvement for
np.searchsorted
- Optional reduced verbosity for np.distutils
- Covariance check in
np.random.multivariate_normal
- Polynomial Classes no longer template based
- More GIL releases
- MaskedArray support for more complicated base classes
- C-API
- Deprecations
- 1.8.2
- 1.8.1
- 1.8.0
- Highlights
- Dropped Support
- Future Changes
- Compatibility notes
- New Features
- Support for linear algebra on stacked arrays
- In place fancy indexing for ufuncs
- New functions partition and argpartition
- New functions nanmean, nanvar and nanstd
- New functions full and full_like
- IO compatibility with large files
- Building against OpenBLAS
- New constant
- New modes for qr
- New invert argument to in1d
- Advanced indexing using np.newaxis
- C-API
- runtests.py
- Improvements
- Changes
- Deprecations
- Authors
- 1.7.2
- 1.7.1
- 1.7.0
- Highlights
- Compatibility notes
- New features
- Reduction UFuncs Generalize axis= Parameter
- Reduction UFuncs New keepdims= Parameter
- Datetime support
- Custom formatter for printing arrays
- New function numpy.random.choice
- New function isclose
- Preliminary multi-dimensional support in the polynomial package
- Ability to pad rank-n arrays
- New argument to searchsorted
- Build system
- C API
- Changes
- Deprecations
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0