1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
==========================
NumPy 1.17.0 Release Notes
==========================
Highlights
==========
* NumPy's FFT implementation has switched to pocketfft
New functions
=============
Deprecations
============
Future Changes
==============
Expired deprecations
====================
Compatibility notes
===================
C API changes
=============
New Features
============
``np.ufunc.reduce`` and related functions now accept a ``where`` mask
---------------------------------------------------------------------
``np.ufunc.reduce``, ``np.sum``, ``np.prod``, ``np.min``, ``np.max`` all
now accept a ``where`` keyword argument, which can be used to tell which
elements to include in the reduction. For reductions that do not have an
identity, it is necessary to also pass in an initial value (e.g.,
``initial=np.inf`` for ``np.min``). For instance, the equivalent of
``nansum`` would be, ``np.sum(a, where=~np.isnan(a))``.
``np.linalg.svd`` and ``np.linalg.pinv`` can be faster on hermitian inputs
--------------------------------------------------------------------------
These functions now accept a ``hermitian`` argument, matching the one added
to ``np.linalg.matrix_rank`` in 1.14.0.
divmod operation is now supported for two ``timedelta64`` operands
------------------------------------------------------------------
The divmod operator now handles two ``np.timedelta64`` operands, with
type signature mm->qm.
Improvements
============
Array comparison assertions include maximum differences
-------------------------------------------------------
Error messages from array comparison tests such as
`np.testing.assert_allclose` now include "max absolute difference" and
"max relative difference," in addition to the previous "mismatch" percentage.
This information makes it easier to update absolute and relative error
tolerances.
Replacement of the `fftpack`-based FFT module by the `pocketfft` library
------------------------------------------------------------------------
Both implementations have the same ancestor (Fortran77 `FFTPACK` by Paul N.
Swarztrauber), but `pocketfft` contains additional modifications which
improve both accuracy and performance in some circumstances. For FFT lengths
containing large prime factors, `pocketfft` uses Bluestein's algorithm, which
maintains `O(N log N)` run time complexity instead of deteriorating towards
`O(N*N)` for prime lengths. Also, accuracy for real-valued FFTs with near-prime
lengths has improved and is on par with complex-valued FFTs.
Further improvements to ``ctypes`` support in ``np.ctypeslib``
--------------------------------------------------------------
A new ``np.ctypeslib.as_ctypes_type`` function has been added, which can be
used to converts a `dtype` into a best-guess `ctypes` type. Thanks to this
new function, ``np.ctypeslib.as_ctypes`` now supports a much wider range of
array types, including structures, booleans, and integers of non-native
endianness.
`numpy.errstate` is now also function decorator
-----------------------------------------------
Currently, if you have a function like::
def foo():
pass
and you want to wrap the whole thing in `errstate`, you have to rewrite it like so::
def foo():
with np.errstate(...):
pass
but with this change, you can do::
@np.errstate(...)
def foo():
pass
thereby saving a level of indentation
Changes
=======
``median`` and ``percentile`` family of functions no longer warn about ``nan``
------------------------------------------------------------------------------
`numpy.median`, `numpy.percentile`, and `numpy.quantile` used to emit a
``RuntimeWarning`` when encountering an `numpy.nan`. Since they return the
``nan`` value, the warning is redundant and has been removed.
``timedelta64 % 0`` behavior adjusted to return ``NaT``
-------------------------------------------------------
The modulus operation with two ``np.timedelta64`` operands now returns
``NaT`` in the case of division by zero, rather than returning zero
|