summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge pull request #16188 from eric-wieser/cleanup-StringConverterSebastian Berg2020-05-111-71/+58
|\ \ \ \ | |/ / / |/| | | MAINT: cleanups to _iotools.StringConverter
| * | | MAINT: Extract a helper function from StringConverterEric Wieser2020-05-081-26/+30
| | | | | | | | | | | | | | | | The previous logic here was very hard to follow, as loop variables were being used after the loop ended, and being conditionally overwritten.
| * | | STY: remove some parens in iterationEric Wieser2020-05-081-3/+3
| | | |
| * | | MAINT: remove unused private membersEric Wieser2020-05-081-2/+0
| | | |
| * | | STY: Remove some weird comments from iotoolsEric Wieser2020-05-081-42/+27
| |/ / | | | | | | | | | Also fix the docstring indentation
* | | ENH: Better error message when ``bins`` has float value in ``histogramdd``. ↵MatteoRaso2020-05-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | (#16129) * Improved one of the error messages for histogramdd.py as outlined in issue #15984 Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+2
| | |
* | | Merge pull request #16125 from WarrenWeckesser/vectorize-bugMatti Picus2020-05-062-8/+83
|\ \ \ | |_|/ |/| | BUG: lib: Fix a problem with vectorize with default parameters.
| * | MAINT: lib: A few changes in some vectorize tests.Warren Weckesser2020-05-021-41/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added a note to some of the tests that the order of the calls is an important part of the test, because the code is testing the caching of the ufuncs. Also reuse a couple functions in the vectorize tests by defining them at the module level.
| * | BUG: lib: Fix a problem with vectorize with default parameters.Warren Weckesser2020-04-302-7/+92
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `otypes` is given to `vectorize` and then the instance is called, it creates a ufunc by calling numpy.core.umath.frompyfunc. The number of arguments given to this ufunc is set to the number of arguments in the call of the vectorize instance. This ufunc is cached, so frompyfunc does not have to be called on the next call. The problem is that, if the function being wrapped has parameters with default values, the number of arguments passed to the vectorize instance can change, and when that happens, a new ufunc must be created by calling frompyfunc with the correct number of arguments. This commit changes the cache of the ufunc from a simple attribute that holds the most recent ufunc to a dictionary whose keys are the number of arguments in the call. The cache is only used when the vectorized function is called with only positional arguments and there are no excluded arguments. If keywords are used, the number of arguments is no longer sufficient to uniquely identify a previously created ufunc. Closes gh-16120.
* | DOC: Update np.copy docstring to include ragged case (#15928)Guilherme Leobas2020-05-051-0/+24
|/ | | | | | | | | We only do a shallow copy of arrays (mainly important for object arrays), so mention that in the documentation. Fixes #15923 Co-Authored-By: Eric Wieser <wieser.eric@gmail.com> Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #16064 from keremh/fix-exception-raiseCharles Harris2020-04-254-10/+14
|\ | | | | ENH: Fix exception causes in four .py files
| * Update numpy/lib/shape_base.pyKerem Hallaç2020-04-251-1/+3
| | | | | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
| * Update numpy/lib/index_tricks.pyKerem Hallaç2020-04-251-1/+3
| | | | | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
| * ENH: Fix exception causes in four .py fileskeremh2020-04-244-10/+10
| |
* | DOC: Add missing bracket (gh-16051)Chunlin2020-04-251-1/+1
|/ | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* DOC: Add converters example to the loadtxt docstring (gh-16043)Warren Weckesser2020-04-231-4/+15
| | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #15967 from anirudh2290/slow_pypy_implMatti Picus2020-04-151-0/+1
|\ | | | | TST: Add slow_pypy support
| * TST: Add slow_pypy supportAnirudh Subramanian2020-04-131-0/+1
| |
* | Added note to angle function docstring about angle(0) being 0.Melissa Weber Mendonca2020-04-131-0/+5
|/
* DOC: Minor fix to _hist_bin_fd documentation (#15839)nglinh2020-04-031-1/+1
| | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>>
* Merge pull request #15883 from eric-wieser/iotools-upgrade_helperMatti Picus2020-04-031-37/+22
|\ | | | | MAINT: Remove duplicated code in iotools.py
| * MAINT: Remove duplicated code in iotools.pyEric Wieser2020-03-311-37/+22
| |
* | TST: Run test_large_zip in a child process (#15893)Anirudh Subramanian2020-04-021-7/+12
| | | | | | * Run test_large_zip in a child process
* | Merge pull request #15867 from eric-wieser/deprecate-tostringMatti Picus2020-04-011-0/+4
|\ \ | | | | | | DEP: Deprecate ndarray.tostring()
| * | DEP: Deprecate ndarray.tostring()Eric Wieser2020-03-301-0/+4
| |/ | | | | | | The corresponding `array.array.tostring()` in the standard library has been deprecated in favor of `tobytes` since Python 3.1 (python/cpython@1ce3eb5c5b4830e69b21865e2d723e22749544e0).
* | MAINT: Clean-up 'next = __next__' used for Python 2 compatibilityMike Taves2020-04-011-4/+0
| |
* | DOC: Fix docstring for _hist_bin_auto.Ross Barnowski2020-03-271-5/+5
| | | | | | | | | | * "bandwidth" -> "bin width" * Minor grammatical fixes
* | MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-268-19/+7
| | | | | | | | | | types (#15816) Cleanup from the dropping of python 2
* | DEP: Do not cast boolean indices to integers in np.delete (#15815)Eric Wieser2020-03-252-30/+35
| | | | | | | | | | | | | | | | This expires a deprecation from 1.8. The corresponding deprecation in `np.insert` has less clear semantics, so has been left to a future patch. Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
* | Merge pull request #15802 from eric-wieser/simplify-insertEric Wieser2020-03-242-29/+8
|\ \ | |/ |/| DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an error
| * DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an errorEric Wieser2020-03-222-29/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the following code worked: ``` >>> some_0d = np.array(1) >>> np.insert(some_0d, "some nonsense", 10, axis=0) array(10) >>> np.insert(some_0d, "some nonsense", 42, axis="some nonsense") array(42) ``` Now these raise AxisError and TypeError, respectively. `delete` is exactly the same.
* | Merge pull request #15812 from eric-wieser/expire-delete-out-of-boundsSebastian Berg2020-03-231-1/+5
|\ \ | | | | | | TST: Remove code that is not supposed to warn out of warning assertion
| * | TST: Remove code that is not supposed to warn out of warning assertionEric Wieser2020-03-231-1/+5
| | |
* | | Merge pull request #15804 from eric-wieser/expire-delete-out-of-boundsSebastian Berg2020-03-232-22/+4
|\ \ \ | |/ / | | | DEP: Make np.delete on out-of-bounds indices an error
| * | DEP: Make np.delete on out-of-bounds indices an errorEric Wieser2020-03-222-22/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that this only affects lists of indices. ```python >>> a = np.arange(3) ```` Before: ```python >>> np.delete(a, 100) IndexError >>> np.delete(a, [100]) DeprecationWarning array([0, 1, 2]) >>> np.delete(a, -1) array([0, 1]) >>> np.delete(a, [-1]) FutureWarning array([0, 1, 2]) ``` After: ```python >>> np.delete(a, 100) IndexError >>> np.delete(a, [100]) IndexError >>> np.delete(a, -1) array([0, 1]) >>> np.delete(a, [-1]) array([0, 1]) ```
* | Merge pull request #15805 from eric-wieser/expired-insert-delete-TypeErrorSebastian Berg2020-03-232-15/+12
|\ \ | | | | | | DEP: Forbid passing non-integral index arrays to `insert` and `delete`
| * | DEP: Forbid passing non-integral index arrays to `insert` and `delete`Eric Wieser2020-03-222-15/+12
| |/ | | | | | | This expires a deprecation warning from back in 1.9.
* | Merge pull request #15799 from eric-wieser/simplify-insertSebastian Berg2020-03-221-7/+11
|\ \ | |/ | | MAINT: Cleanups to np.insert and np.delete
| * MAINT: Make the axis logic for delete match insert.Eric Wieser2020-03-221-5/+4
| | | | | | | | No behavior change here unless someone implements a subclass where `arr.ravel().ndim == 0`, which no sane person would do anyway.
| * MAINT: Add missing deprecation dates and versionsEric Wieser2020-03-221-1/+4
| |
| * MAINT: Remove some weird syntax for kwargsEric Wieser2020-03-221-1/+1
| |
| * MAINT: Add an explanatory comment for some weird codeEric Wieser2020-03-221-0/+2
| |
* | BUG, TST: fix f2py for PyPy, skip one test for PyPy (#15750)Matti Picus2020-03-181-8/+9
|/ | | * BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
* MAINT: remove useless `global` statementsEric Wieser2020-03-181-1/+0
| | | | | | | `global` is only needed if a variable appears on the left of an assignment. These variables do not. Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
* MAINT: lib: PEP-8 clean up in test_arraysetops.py.Warren Weckesser2020-03-151-38/+41
|
* BUG: lib: Handle axes with length 0 in np.unique.Warren Weckesser2020-03-152-4/+22
| | | | | | | Tweak a few lines so that arrays with an axis with length 0 don't break the np.unique code. Closes gh-15559.
* TST: lib: Add a unit test for np.unique applied to arrays with a length 0 axis.Huon Wilson2020-03-151-0/+35
| | | | | This code is from github user huonw, from this PR: https://github.com/numpy/numpy/pull/15565
* ENH: Add `subok` parameter to np.copy function (cf. gfh6509) (gh-15685)Ross Barnowski2020-03-112-3/+19
| | | | | This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting. This PR closes #3474 and #15570
* Merge pull request #15534 from seberg/deprecate-abstract-scalar-typesMatti Picus2020-03-063-11/+16
|\ | | | | DEP: Do not allow "abstract" dtype conversion/creation