summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add examples for intersect1d and union1d of more than two arrays.Christian Brueffer2014-10-151-0/+10
| | | | | | | | The approach was suggested by Jaime Frio in issue #5179.
* | BUG: np.unique with chararray + inverse_indexCJ Carey2014-09-231-1/+1
| | | | | | | | | | The call to `empty_like` was trying to use the `chararray` subclass, which doesn't support the `np.intp` dtype.
* | DOC: warn about using a set with 'in1d'.Patrick Peglar2014-08-311-0/+4
| |
* | ENH: Speed up `unique` with `return_inverse`jaimefrio2014-08-271-2/+3
|/ | | | This replaces a sort with fancy indexing.
* STY: Make files in numpy/lib PEP8 compliant.Charles Harris2014-07-311-7/+7
| | | | The rules enforced are the same as those used for scipy.
* MAINT: Fixes for problems in numpy/lib revealed by pyflakes.Charles Harris2014-07-311-4/+7
| | | | | | 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.
* BUG: Correct behavior for lists of tuples in unique, closes #4785jaimefrio2014-06-061-7/+1
| | | | | | | | 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`.
* ENH: add a 'return_counts=' keyword argument to `np.unique`jaimefrio2014-04-051-26/+42
| | | | | | | | | | | | | | | | 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`.
* BUG: Fixes #2799jaimefrio2014-02-211-2/+1
| | | | | Use `np.sort` instead of `sorted` when the input is a list and no indices are requested. Fixes #2799.
* ENH: add `invert` parameter to numpy.in1d().Julien Phalip2013-04-081-7/+26
|
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+3
| | | | | | | | 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.
* BUG: Fix regression for in1d with non-array inputSebastian Berg2012-12-081-0/+4
| | | | | | | | | 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"
* DOC: merge doc wiki edits. A number of small edits in linalg and lib.Ralf Gommers2012-07-071-8/+8
|
* BUG: ticket #2063, make unique return consistent index.Bryan Van de Ven2012-03-301-3/+6
| | | | | | 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.
* ENH: missingdata: Implemented boolean assignment, working with NA masksMark Wiebe2011-08-271-1/+1
|
* ENH: speed up in1d() in the case of ar1 >> ar2. Closes #1603.rgommers2011-05-291-2/+10
| | | | | | A timing script justifying the switching criterion is attached to ticket 1603. Thanks to Neil Crighton.
* DEP: remove unique1d, setmember1d and intersect1d_nu.rgommers2011-03-111-76/+2
|
* Merge deprecate_with_doc into deprecate(message="...").Stefan van der Walt2009-10-251-4/+4
|
* Docstring update: libPauli Virtanen2009-10-021-45/+91
|
* Docstring updates, part 1Pauli Virtanen2009-10-021-11/+28
|
* Fix to setdiff1d (and masked version) + tests (#1133, by N.C.)Robert Cimrman2009-07-201-1/+4
|
* Enhancements to arraysetops (ticket #1133, by Neil Crighton)Robert Cimrman2009-07-081-196/+164
|
* Merge from doc wikiPauli Virtanen2009-06-191-26/+72
|
* Added setmember1d_nu to arraysetops.Robert Cimrman2009-06-081-19/+43
|
* Merge from the doc wikiPauli Virtanen2009-03-241-6/+16
|
* * replace np.asarray by np.asanyarray in unique1dpierregm2009-01-191-2/+8
|
* Import documentation from doc wiki (part 2, work-in-progress docstrings, but ↵Pauli Virtanen2008-10-281-14/+14
| | | | they are still an improvement)
* Removed unused imports.Alan McIntyre2008-09-091-1/+0
|
* Unique1d will now return unique as well as reverse indices. Fix order ofStefan van der Walt2008-08-131-8/+45
| | | | returns [patch by Robert Cimrman].
* ran reindentJarrod Millman2008-08-081-1/+0
|
* Merge from documentation editor.Stefan van der Walt2008-08-051-42/+73
|
* Standardized NumPy import as "import numpy as np".Alan McIntyre2008-07-231-84/+22
| | | | Moved unique1d benchmarking code to new benchmarks directory.
* Merge documentation changes from wiki.Stefan van der Walt2008-05-191-71/+103
|
* ran reindentJarrod Millman2008-02-081-1/+1
|
* fixed setmember1d for string arraysRobert Cimrman2007-12-201-3/+6
|
* Edited module docstring.Robert Cimrman2007-11-201-3/+5
|
* Whitespace cleanup.Stefan van der Walt2007-01-081-6/+6
|
* * Fix #410 by using the stable mergesort instead of the unstable default ↵Robert Kern2007-01-081-45/+147
| | | | | | | 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).
* (no commit message)Robert Cimrman2006-10-121-7/+5
|
* modernized to use new numpy features, speed-up of unique1d, doc updateRobert Cimrman2006-10-121-75/+95
|
* Change unique1d's argument name from retindx to return_index.Stefan van der Walt2006-09-281-6/+8
|
* Remove sorted from unique1d. Add testall to test if level > 10. Remove ↵Travis Oliphant2006-09-201-1/+1
| | | | compiler warning.
* Support empty arrays in setxor1d and setdiff1d.Stefan van der Walt2006-09-191-2/+8
|
* Fix unique1d for empty sets. Closes r208.Stefan van der Walt2006-09-191-6/+10
|
* Add ediff1d support for empty arrays.Stefan van der Walt2006-09-181-23/+12
| | | | | Fix ediff1d for to_begin or to_end = 0. Allow insert to operate on empty arrays.
* Clean-up some un-needed default axes. Fix default axes of ma.sum and ma.productTravis Oliphant2006-08-291-1/+1
|
* Add axis arguments to various functions so as not to rely on the defaults.Travis Oliphant2006-08-291-1/+1
|
* Restore un-needed axis argumentsTravis Oliphant2006-08-291-4/+4
|