| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The "do not use" comment has been here since bb0e4f356cce2f199d9c08ffe572fbabadc846d1.
|
|
|
|
|
| |
* DOC: update val to be scalar or array like optional closes #16901
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|\
| |
| | |
BUG: fix mgrid output for lower precision float inputs
|
| |
| |
| |
| |
| |
| | |
Floats besides float64 were being coerced to integers
and complex step sizes for the index trick classes
would fail for complex64 input. Fixes #16466
|
|/ |
|
|
|
|
|
|
| |
* adding documentation on passing dimensions to
ndindex as a tuple
Co-authored-by: sun <sun@vosdbt.org>
|
|
|
| |
DOC: fixes to capitalization and header lines
|
|
|
| |
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
| |
|
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|\
| |
| | |
BUG: Preserve types of empty arrays in ix_ when known
|
| |\ |
|
| | |
| | |
| | |
| | | |
Fixes regression in #5805
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without the newline and indent, the markup is not interpreted.
Note that in the see-also `np.lib.index_tricks.nd_grid` is reference but
not linked as it appear to not be autogenerated, but this is another
issue.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes GH-12271
Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to
``'numpy'``, or appears in an explicit whitelist of undocumented functions and
exported bulitins. These should eventually be documented or removed.
I also identified a handful of functions for which I had accidentally not setup
dispatch for with ``__array_function__`` before, because they were listed under
"ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in
trusting code comments :).
|
| | |
| | |
| | | |
BUG: test and fix import linspace in index_tricks
|
| | | |
|
| | | |
|
| |/
|/|
| |
| | |
np.lib.arraypad through np.lib.nanfunctions
|
| |
| |
| |
| |
| |
| | |
From the header comment in add_newdocs, it is only intended for C modules.
This also fixes `help(np.mgrid)`, which previously only showed the help for `nd_grid`
|
| |
| |
| |
| | |
np.ogrid was not tested anyway, so this was not caught.
|
| |
| |
| |
| | |
It's not at all clear what trans1d is supposed to do here, but it's certainly not supposed to change value between elements!
|
| |
| |
| |
| | |
Fixes gh-9233
|
| |
| |
| |
| |
| |
| |
| | |
This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
|
| |
| |
| |
| | |
Bare except is very rarely the right thing
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes #8815
|
| |
| |
| |
| |
| | |
Also adds a test for the disabled-by-design behaviour - this would return
raw matrices, not masked arrays
|
| | |
|
|/
|
|
| |
I mostly use that object to bind 1D arrays as columns, so I added an example for that use case.
|
|\
| |
| | |
DOC: Mention boolean arrays in the ix_ documentation.
|
| | |
|
|/ |
|
|
|
|
|
| |
This code was only here for Python 2.5 compatibility, but numpy requires 2.7
at minimum
|
|
|
|
| |
Closes gh-6863.
|
| |
|
|
|
|
|
|
| |
closes gh-6062
done with help of Sebastian Berg! =)
|
| |
|
|\
| |
| | |
ENH: add np.stack
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The motivation here is to present a uniform and N-dimensional interface for
joining arrays along a new axis, similarly to how `concatenate` provides a
uniform and N-dimensional interface for joining arrays along an existing axis.
Background
~~~~~~~~~~
Currently, users can choose between `hstack`, `vstack`, `column_stack` and
`dstack`, but none of these functions handle N-dimensional input. In my
opinion, it's also difficult to keep track of the differences between these
methods and to predict how they will handle input with different
dimensions.
In the past, my preferred approach has been to either construct the result
array explicitly and use indexing for assignment, to or use `np.array` to
stack along the first dimension and then use `transpose` (or a similar method)
to reorder dimensions if necessary. This is pretty awkward.
I brought this proposal up a few weeks on the numpy-discussion list:
http://mail.scipy.org/pipermail/numpy-discussion/2015-February/072199.html
I also received positive feedback on Twitter:
https://twitter.com/shoyer/status/565937244599377920
Implementation notes
~~~~~~~~~~~~~~~~~~~~
The one line summaries for `concatenate` and `stack` have been (re)written to
mirror each other, and to make clear that the distinction between these functions
is whether they join over an existing or new axis.
In general, I've tweaked the documentation and docstrings with an eye toward
pointing users to `concatenate`/`stack`/`split` as a fundamental set of basic
array manipulation routines, and away from
`array_split`/`{h,v,d}split`/`{h,v,d,column_}stack`
I put this implementation in `numpy.core.shape_base` alongside `hstack`/`vstack`,
but it appears that there is also a `numpy.lib.shape_base` module that contains
another larger set of functions, including `dstack`. I'm not really sure where
this belongs (or if it even matters).
Finally, it might be a good idea to write a masked array version of `stack`.
But I don't use masked arrays, so I'm not well motivated to do that.
|
| | |
|