| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
The docstring now says what to expect if you call
intersect1d(assume_unique=True) but pass in non-unique data.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
| |
I suggest adding `repeat` to the "See also" section of `unique` (and vice versa) since each is the inverse of the other.
|
|
|
|
|
|
|
| |
Tweak a few lines so that arrays with an axis with length 0
don't break the np.unique code.
Closes gh-15559.
|
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit c088383cb290ca064d456e89d79177a0e234cb8d and
uses the same kind casting rule for the additional keyword arguments
``to_end`` and ``to_begin``. This results in slightly more leniant
behaviour for integers (which can now have overflows that are
hidden), but fixes an issue with the handling of NaN.
Generally, this behaviour seems more conistent with what NumPy does
elsewhere. The Overflow issue exists similar in many other places
and should be solved by integer overflow warning machinery while
the actual cast takes place.
Closes gh-13103
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* 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 :).
|
| |
|
|
|
|
|
|
|
|
| |
* add unit test for setdiff1d covering code
path where assume_unique is True
* remove setdiff1d docstring guarantee that
returned value is sorted -- it is not
|
|
|
|
| |
np.lib.arraypad through np.lib.nanfunctions
|
| |
|
|
|
|
|
|
|
|
|
| |
The function was failing for non-ndarray objects that defined
that defined __array__, in particular `xarray.DataArray`. Fix
by calling asanyarray on the inputs, which was done implicitly
before.
Closes #11772.
|
|
|
|
|
|
|
|
| |
Eliminates all mentions of `np.where(cond)`, instead pointing the reader to np.nonzero.
Also changes some example numbers to avoid collisions, making them easier to follow.
Some minor doc improvements for np.ma.where too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* added function commonpts1d
* Update arraysetops.py
* Update arraysetops.py
* modified intersect1d to return common indices
Proposed this idea in previous pull request (https://github.com/numpy/numpy/pull/10683) and made suggested changes for implementing this idea to have relevant common indices that correspond to the values in the intersection of the two arrays.
* update intersect1d with suggested changes
* implemented return_indices options for intersect1d
I've tested out the above code and for the ~10 different test sets I've tried it's worked thus far. It's probably not the cleanest implementation but it works and is vectorized.
* cleaned up structure for intersect1d
* fixed copy-paste error, added second test, changed a conditional
* Testing return_indices in intersect1d
* formatting
* created separate test function for intersect1d indices, added spaces after commas
* fixed up example and some style
* fixed style
* style change
* removed one example
* removed extra space
* added version number for return_indices
* added 'return_indices' keyword for np.intersect1d
* fixed formatting
* updated return_indices entry
* fixed some typos and style
* added bit about first instance of a value being used
* STY: Fix comment formats
* DOC: missing space
* DOC: correct parameter names in docstring
* made suggested changes
* fixed a mistake from previous update
also added documentation for comm1, comm2 to match doc from np.unique
* added in tests for 2d inputs
* STY: Add missing spaces around commas
* TST: Correct array to actually be unique
* STY: Spaces at beginning of comments
|
|
|
|
|
|
|
|
| |
The optimization was to sort integer subarrays by treating them as
strings of unsigned bytes. That worked fine for finding the unique
subarrays, but the sort order of the results could be unexpected.
Closes #10495.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Largely taken from gh-9531
|
|\
| |
| | |
BUG: arrays not being flattened in `union1d`
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
ENH: Don't show the boolean dtype in array_repr
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
We need to find the index which is not the same with the left and right, I think np.logical_and's meaning is more clear and I test this got a speed up
|
|
|
|
| |
Fixes #9137
|
| |
|
|
|
|
|
|
| |
This fixes gh-8331
Also update the docs for arraysetops to remove the outdated "1D" from the
description, which was already incorrect for np.unique.
|
| |
|
| |
|
|
|
|
|
|
| |
Special case to_begin and to_end both equal to None, avoiding
subsequent steps. Particulary faster for small arrays where
overhead plays a big role.
|
|
|
|
|
| |
Eliminate a copy operation when to_begin or to_end is given. Also
use ravel instead of flatiter which is much faster.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these fixes involve putting blank lines around
.. versionadded:: x.x.x
and
.. deprecated:: x.x.x
Some of the examples were also fixed.
|
|
|
|
|
| |
Fixes #5846 (If called with an empty array as first argument, the returned
array had dtype bool instead of the dtype of the input array)
|
|\
| |
| |
| | |
DOC: Describe return_counts keyword in np.unique docstring
|
| | |
|
| | |
|