| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
| |
| |
| | |
Fixes #5804
|
|/
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
|
|
|
| |
Allows access to internal functions for the file.
|
| |
|
|
|
|
| |
The rules enforced are the same as those used for scipy.
|
|
|
|
|
|
|
| |
The zerosize_ok flag to nditer was missing, so that it did not
allow for 0-sized iteration.
Closes gh-3714
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
| |
Now is as good a time as any with open PR's at a low.
|
|
|
|
| |
Following deprecations would cause problems otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idioms fixer makes the following replacements.
1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)
There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct. The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.
Closes #3062.
|