Time to start planning for the 1.20.x branch. These are my thoughts at the
- Keep support for Python 3.6. Python 3.7 came out in June 2018, which
seems too recent to be our oldest supported version.
- Drop Python 3.6 for 1.21.x, that will make the oldest supported
version about three years old.
- Drop manylinux1 for 1.21.x. It would be nice to drop earlier, but
manylinux2010 is pretty recent.
There were 33 wheels in the 1.19.3 release, I think we can live with that
for 1.20.x. I'm more worried about our tools aging out. After Python has
settled into its yearly release cycle, I think we will end up supporting
the latest 4 versions.
I would like to draw the attention of this list to PR #17394  that
adds the implementation of a sliding window view to numpy.
Having a sliding window view in numpy is a longstanding open issue (cf
#7753  from 2016). A brief summary of the discussions surrounding it
can be found in the description of the PR.
This PR implements a sliding window view based on stride tricks.
Following the discussion in issue #7753, a first implementation was
provided by Fanjin Zeng in PR #10771. After some discussion, that PR
stalled and I picked up the issue in the present PR #17394. It is based
on the first implementation, but follows the changed API as suggested by
Code reviews have been provided by Bas van Beek, Stephen Hoyer, and Eric
Wieser. Sebastian Berg added the "62 - Python API" label.
Do you think this is suitable for inclusion in numpy?
Do you consider the PR ready?
Do you have suggestions or requests?
Thanks for your time and consideration!
I'd like to share this announcement blog post about the creation of a
consortium for array and dataframe API standardization here:
https://data-apis.org/blog/announcing_the_consortium/. It's still in the
beginning stages, but starting to take shape. We have participation from
one or more maintainers of most array and tensor libraries - NumPy,
TensorFlow, PyTorch, MXNet, Dask, JAX, Xarray. Stephan Hoyer, Travis
Oliphant and myself have been providing input from a NumPy perspective.
The effort is very much related to some of the interoperability work we've
been doing in NumPy (e.g. it could provide an answer to what's described in
At this point we're looking for feedback from maintainers at a high level
(see the blog post for details).
Also important: the python-record-api tooling and data in its repo has very
granular API usage data, of the kind we could really use when making
decisions that impact backwards compatibility.
With the recent merging of numpy/numpy#16759<https://github.com/numpy/numpy/pull/16759> we're at the point where `ndarray` can be made generic w.r.t. its dtype and shape.
An open question which yet remains is to order in which these two parameters should appear (numpy/numpy#16547<https://github.com/numpy/numpy/issues/16547>):
* `ndarray[Dtype, Shape]`
* `ndarray[Shape, Dtype]`
There has been a some discussion about this question in issue 16547, but a consensus has not yet to be reached.
Most people seem to slightly preferring one option over the other.
Are there any further thoughts on this subject?
Bas van Beek
For ndindex (https://quansight.github.io/ndindex/), the biggest issue
with the API is that to use an ndindex object to actually index an
array, you have to use a[idx.raw] instead of a[idx]. This is because
for NumPy arrays, you cannot allow custom objects to be indices. The
exception is objects that define __index__, but this only works for
integer indices. If __index__ returns anything other than an integer,
you get an IndexError. This is annoying because it's easy to forget to
do this when working with the ndindex API, and the error message from
NumPy isn't informative about what went wrong unless you know to
I'd like to propose an API that would allow custom objects to define
how they should be converted to a standard NumPy index, similar to
__index__ but that supports all index types. I think there are two
- Allow __index__ to return any index type, not just integers. This is
the simplest because it reuses an existing API, and __index__ is the
best possible name for this API. However, I'm not sure, but this may
actually conflict with the text of PEP 357
(https://www.python.org/dev/peps/pep-0357/). Also, some other APIs use
__index__ to check if something is an indexable integer, which
wouldn't accept generic index. For example, elements of a slice can be
any object that defines __index__.
- Add a new __numpy_index__ API that works like
return <tuple, integer, slice, newaxis, ellipsis, or integer or
In NumPy, __getitem__ and __setitem__ on ndarray would first check if
the input index type is one of the known types as it currently does,
then it would try __index__, and if neither of those fails, it would
call __numpy_index__(index) and use that.
Note: there is a more general way that NumPy arrays could allow
__getitem__ to be defined on custom objects, which I am NOT proposing.
Instead of an API that returns one of the current predefined index
types (tuple, integer, slice, newaxis, ellipsis, or integer or boolean
array), there could instead be an API that takes the array as input
and returns another array (or view) as an output. This would allow an
object to define itself as an index in arbitrary ways, even if such an
index would not actually be possible via traditional indexing. There
are definitely some interesting ideas that could be done with this,
but this idea would be much more complicated, and isn't something that
I need. Unless the community feels that a more general API like this
would be preferred, I would suggest deferring something like it to a
What would be the best way to go about getting something like this
implemented? Is it simple enough that we can just work out the details
here and on a pull request, or should I write a NEP?
I wonder if there is an efficient way to draw multinomial random samples. For
univariate sampling, we can do that for different parameters and desired
shape, but neither of rng nor multinomial function in numpy.random is able
to achieve that. To be specific, can we draw multinomial samples for
different probabilities and different n?
I asked the question on Stackoverflow here:
Seems like there isn't a function to do that.
Thank you and appreciate numpy,
Sent from: http://numpy-discussion.10968.n7.nabble.com/
Seems that is pretty easy to transfer a github repo to another owner.
Should we do this for the numpy-wheels repo? That would put all the
management in one place and now might be a good time to do it before the
On behalf of the NumPy team I am pleased to announce that NumPy 1.19.3 has
been released. NumPy 1.19.3 is a small maintenance release with two major
- Python 3.9 binary wheels on all supported platforms,
- OpenBLAS fixes for Windows 10 version 2004 fmod bug.
This release supports Python 3.6-3.9 and is linked with OpenBLAS 3.12 to
avoid some of the fmod problems on Windows 10 version 2004. Microsoft is
aware of the problem and users should upgrade when the fix becomes
available, the fix here is limited in scope.
NumPy Wheels for this release can be downloaded from the PyPI
<https://pypi.org/project/numpy/1.19.3/>, source archives, release notes,
and wheel hashes are available on Github
<https://github.com/numpy/numpy/releases/tag/v1.19.3>. Linux users will
need pip >= 0.19.3 in order to install manylinux2010 and manylinux2014
A total of 8 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
- Charles Harris
- Chris Brown +
- Daniel Vanzo +
- E. Madison Bray +
- Hugo van Kemenade +
- Ralf Gommers
- Sebastian Berg
- @danbeibei +
*Pull requests merged*
A total of 10 pull requests were merged for this release.
- #17298: BLD: set upper versions for build dependencies
- #17336: BUG: Set deprecated fields to null in PyArray_InitArrFuncs
- #17446: ENH: Warn on unsupported Python 3.10+
- #17450: MAINT: Update test_requirements.txt.
- #17522: ENH: Support for the NVIDIA HPC SDK nvfortran compiler
- #17568: BUG: Cygwin Workaround for #14787 on affected platforms
- #17647: BUG: Fix memory leak of buffer-info cache due to relaxed
- #17652: MAINT: Backport openblas_support from master.
- #17653: TST: Add Python 3.9 to the CI testing on Windows, Mac.
- #17660: TST: Simplify source path names in test_extending.