summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Remove duplicated code in iotools.pyEric Wieser2020-03-311-37/+22
|
* 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
| * DEP: Do not allow "abstract" dtype conversion/creationSebastian Berg2020-02-063-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These dtypes do not really make sense as instances. We can (somewhat) reasonably define np.dtype(np.int64) as the default (machine endianess) int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")` should return arr_of_<f8, but that would be very noisy!) However, `np.integer` as equivalent to long, is not well defined. Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you intend to put Decimal objects into the array. But it is misleading, since there is no special meaning to it at this time. The biggest issue with it, is that `arr.astype(np.floating)` looks like it will let float32 or float128 pass, but it will force a float64 output! Arguably downcasting is a bug in this case. A related issue is `np.dtype("S")` and especially "S0". The dtype "S" does make sense for most or all places where `dtype=...` can be passed. However, it is conceptionally different from other dtypes, since it will not end up being attached to the array (unlike "S2" which would be). The dtype "S" really means the type number/DType class of String, and not a specific dtype instance.
* | Merge pull request #15487 from ericmariasis/quantileSebastian Berg2020-03-042-1/+11
|\ \ | | | | | | BUG: Fixing result of np quantile edge case
| * | BUG: Fixing result of np quantile edge caseEric Mariasis2020-02-282-1/+11
| | |
* | | DOC: Update to clarify actual behavior real_if_(all elements)_close (gh-15644)and-sang2020-02-281-5/+6
|/ / | | | | | | | | | | Updated the description to consider all array elements Updated the examples to use multiple elements array, to show that one element not close enough prevent for the whole array to be considered as real Closes #15626
* | BUG: fix doctest exception messagesmattip2020-02-281-1/+3
| |
* | DOC: fix documentation for apply_along_axis (#15619)Heshy Roskes2020-02-201-2/+2
| |
* | Merge pull request #15465 from mwtoews/importsSebastian Berg2020-02-071-1/+0
|\ \ | |/ |/| MAINT: cleanup unused imports; avoid redefinition of imports
| * MAINT: cleanup unused imports; avoid redefinition of importsMike Taves2020-02-061-1/+0
| | | | | | | | | | | | | | * Cleanup unused imports (F401) of mostly standard Python modules, or some internal but unlikely referenced modules * Where internal imports are potentially used, mark with noqa * Avoid redefinition of imports (F811)
* | Update unique docstring exampleJon Morris2020-02-041-2/+2
|/
* MAINT: Remove sys.version checks (gh-#15373)Seth Troisi2020-01-281-35/+0
| | | More sys.version cleanup.
* BUG: np.load does not handle empty array with an empty descr (#15397)Sha Liu2020-01-272-8/+13
| | | | | | | The bug occurs since numpy 1.16. Before that empty descr corresponds to `np.dtype([])`. This fixes the problem by following numpy 1.15's behavior. Closes gh-15396
* STY: use 'yield from <expr>' for simple cases (#15444)Mike Taves2020-01-274-28/+15
| | | | | | | | | This PR uses simple cases of PEP 380 to rewrite: for v in g: yield v into: yield from <expr>
* Merge pull request #15421 from sethtroisi/contextlib_py2Matti Picus2020-01-271-21/+12
|\ | | | | ENH: Make use of ExitStack in npyio.py
| * ENH: Make use of ExitStack in npyio.pySeth Troisi2020-01-241-21/+12
| |
* | MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-1/+0
|/
* Merge pull request #15407 from charris/replace-basestringSebastian Berg2020-01-235-22/+18
|\ | | | | MAINT: Replace basestring with str.
| * MAINT: Replace basestring with str.Charles Harris2020-01-235-22/+18
| | | | | | | | | | | | | | This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py
* | Merge pull request #15398 from mwtoews/urllibCharles Harris2020-01-231-15/+5
|\ \ | |/ |/| MAINT: Revise imports from urllib modules
| * MAINT: Revise imports from urllib modulesMike Taves2020-01-241-15/+5
| |
* | MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-235-8/+2
|/
* Merge pull request #15377 from sethtroisi/misc_cleanups2Matti Picus2020-01-231-1/+1
|\ | | | | MAINT: Cleanup python2 references
| * MAINT: Cleanup python2 referencesSeth Troisi2020-01-211-1/+1
| |
* | Merge pull request #15379 from sethtroisi/misc_cleanups3Matti Picus2020-01-231-3/+2
|\ \ | | | | | | MAINT: Python2 Cleanups
| * | MAINT: Python2 CleanupsSeth Troisi2020-01-211-3/+2
| |/
* | MAINT: Revise imports from collections.abc moduleMike Taves2020-01-221-7/+2
|/
* NEP: issue deprecation warning when creating ragged array (NEP 34)Matti Picus2020-01-212-15/+20
| | | | This implements NEP 34.
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-206-158/+36
|
* MAINT: Fix mistype in histogramdd docstringKirill Zinovjev2020-01-191-2/+2
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-157-96/+38
|
* Merge pull request #15307 from sethtroisi/sys_version_preMatti Picus2020-01-161-5/+2
|\ | | | | MAINT: cleanup sys.version dependant code
| * MAINT: cleanup sys.version dependant codeSeth Troisi2020-01-121-5/+2
| |