summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #16284 from eric-wieser/extract-lerpSebastian Berg2020-05-191-62/+58
|\ \ \ | |/ / |/| | MAINT: Clean up the implementation of quantile
| * | MAINT: remove workaround for fixed issue Eric Wieser2020-05-191-2/+0
| | | | | | | | | take now correctly returns `out`, even on 0d arrays
| * | MAINT: Remove special cases for 0d arrays in quantileEric Wieser2020-05-181-62/+55
| | | | | | | | | | | | This also simplifies the axis handling logic, taking advantage of the fact we know `axis` is 0 for the rest of the function body
| * | MAINT: Extract a lerp helper function to make the algorithm of quantile clearerEric Wieser2020-05-181-4/+9
| |/ | | | | | | This does not affect the behavior in any way
* | Merge pull request #16156 from WarrenWeckesser/deprecate-dualSebastian Berg2020-05-191-1/+0
|\ \ | | | | | | DEP: Deprecate `numpy.dual`.
| * | DEP: Deprecate `numpy.dual`.Warren Weckesser2020-05-041-1/+0
| | | | | | | | | | | | | | | | | | Add a deprecation warning in the `numpy.dual` module, and remove the use of `numpy.dual` from the few places where it is used in the numpy code.
* | | Merge pull request #16242 from seberg/genfromtxt-default-regressionMatti Picus2020-05-193-5/+15
|\ \ \ | |_|/ |/| | BUG: Fix default fallback in genfromtxt
| * | Update numpy/lib/_iotools.pySebastian Berg2020-05-181-1/+2
| | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | BUG: Fix default fallback in genfromtxtSebastian Berg2020-05-183-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This affected (for example?) if the `dtype=object` was used without a converter, meaning that the default one is used. And this is currently the last one, which is `string_` (and thus bytes). Closes gh-16189
* | | MAINT: Avoid moving axes around multiple timesEric Wieser2020-05-171-15/+5
| | | | | | | | | | | | It's easier to move the relevant axis to position 0 in `ap` first than it is to move it for every relevant object simultaneously.
* | | MAINT: Remove a pointless ifEric Wieser2020-05-171-4/+1
| | | | | | | | | | | | The `add` ufunc is happy to handle `out=None` by itself
* | | DOC: Fix typos and cosmetic issuesMartin Michlmayr2020-05-171-1/+1
| | |
* | | Merge pull request #16197 from timhoffm/doc-stackSebastian Berg2020-05-151-3/+5
|\ \ \ | |/ / |/| | DOC: Unify cross-references between array joining methods
| * | DOC: Unify cross-references between array joining methodsTim Hoffmann2020-05-101-3/+5
| | |
* | | 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]) ```