| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
| |
| |
| | |
The approach was suggested by Jaime Frio in issue #5179.
|
| |
| |
| |
| |
| | |
The call to `empty_like` was trying to use the `chararray` subclass,
which doesn't support the `np.intp` dtype.
|
| | |
|
|/
|
|
| |
This replaces a sort with fancy indexing.
|
|
|
|
| |
The rules enforced are the same as those used for scipy.
|
|
|
|
|
|
| |
Some of those problems look like potential coding errors. In those
cases a Fixme comment was made and the offending code, usually an
unused variable, was commented out.
|
|
|
|
|
|
|
|
| |
np.unique produces wrong results when passed a list of tuples and
no keyword arguments, as it fails to recognize it as a multidim
array, but handles it as a 1D array of objects. The only way around
this seems to be to completely eliminate the fast path for non-array
inputs using `set`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds a new keyword argument to `np.unique` that returns the
number of times each unique item comes up in the array. This allows
replacing a typical numpy construct:
unq, _ = np.unique(a, return_inverse=True)
unq_counts = np.bincount(_)
with a single line of code:
unq, unq_counts = np.unique(a, return_counts=True)
As a plus, it runs faster, because it does not need the extra
operations required to produce `unique_inverse`.
|
|
|
|
|
| |
Use `np.sort` instead of `sorted` when the input is a list and no indices
are requested. Fixes #2799.
|
| |
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.
1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:
* all setup.py files
* numpy/core/code_generators/generate_umath.py
* numpy/core/code_generators/generate_numpy_api.py
* numpy/core/code_generators/generate_ufunc_api.py
2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:
* core/__init__.py,
* core/numeric.py,
* core/_internal.py,
* core/arrayprint.py,
* core/fromnumeric.py,
* numpy/__init__.py,
* lib/npyio.py,
* lib/function_base.py,
* fft/fftpack.py,
* random/__init__.py
Closes #3172
|
|
|
|
|
|
|
|
| |
This should be harmless, as we already are division clean. However,
placement of this import takes some care. In the future a script
can be used to append new features without worry, at least until
such time as it exceeds a single line. Having that ability will
make it easier to deal with absolute imports and printing updates.
|
|
|
|
|
|
|
|
|
| |
There was a regression introduced by the speed improvement in
commit 6441c2a. This fixes it, and generally ravels the arrays for
np.in1d. However it can be argued that at least the first array should
not be ravelled in the future.
Fixes "Issue gh-2755"
|
| |
|
|
|
|
|
|
| |
Make unique use mergesort when return_index is true. This quarantees that
the returned indices are of the first occurrence of the unique elements and
makes the behavior better defined and consistent.
|
| |
|
|
|
|
|
|
| |
A timing script justifying the switching criterion is attached to ticket 1603.
Thanks to Neil Crighton.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
they are still an improvement)
|
| |
|
|
|
|
| |
returns [patch by Robert Cimrman].
|
| |
|
| |
|
|
|
|
| |
Moved unique1d benchmarking code to new benchmarks directory.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
sort in setmember1d().
* Add some more information to the function docstrings.
* Reduced the "See also" sections of the docstrings to point to the module instead of the full list of functions (some of which were not entirely relevant).
|
| |
|
| |
|
| |
|