summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | ENH: Add annotations for `np.lib.function_base`Bas van Beek2021-09-301-18/+290
| |/ /
* | | incorporated suggested editJonas I. Liechti2021-10-241-1/+0
| | | | | | | | | Co-authored-by: Mukulika <60316606+Mukulikaa@users.noreply.github.com>
* | | removed redundant commentJonas Liechti2021-10-221-3/+0
| | |
* | | type-o: used element instead of arrayJonas Liechti2021-10-051-3/+3
| | |
* | | adding example: also highlight priority in multiple matchesJonas Liechti2021-10-051-2/+11
| | |
* | | use an example that also shows default valueJonas Liechti2021-10-011-3/+3
|/ /
* | ENH: Add spaces after punctuation in dtype repr/str. (#19686)Antony Lee2021-09-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names':['a'], 'formats':['<i8'], 'offsets':[2], 'itemsize':10}) ``` After: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10}) ``` * Allow switching back to old dtype printing format. * Add changelog.
* | DOC: Update links to online copy of Abramowitz and Stegun.warren2021-09-281-1/+1
| |
* | DOC: rename np.lib.scimath to np.emathPamphile ROY2021-09-271-11/+10
| |
* | Merge pull request #19949 from BvB93/recCharles Harris2021-09-241-2/+3
|\ \ | | | | | | ENH: Add annotations for `np.rec`
| * | MAINT: Change the `npyio` recarray dtypes from `void` to `record`Bas van Beek2021-09-241-2/+3
| | |
* | | MAINT: lib: Check that the dtype given to fromregex is structured.warren2021-09-222-8/+16
|/ / | | | | | | | | | | | | | | | | | | In fromregex, add a check that verifies that the given dtype is a structured datatype. This avoids confusing error messages that can occur when the given data type is not structured. Also tweaked the code in the Examples section. Closes gh-8891.
* | Merge pull request #19905 from Samyak2/polynomial-fit-doc-formattingCharles Harris2021-09-211-6/+12
|\ \ | | | | | | DOC: fix docstring formatting of polynomial fit method return values.
| * | DOC: fix formatting of a return value of polynomial fit methodsSamyak S Sarnayak2021-09-211-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #19897 The 2nd return value of the following methods/functions were badly formatted and the list was all appearing in a single line. Changed them to separate points which are rendered nicely. - numpy.polyfit - numpy.ma.polyfit - numpy.polynomial.polynomial.polyfit - numpy.polynomial.polynomial.Polynomial.fit - numpy.polynomial.chebyshev.chebfit - numpy.polynomial.chebyshev.Chebyshev.fit - numpy.polynomial.hermite.hermfit - numpy.polynomial.hermite.Hermite.fit - numpy.polynomial.hermite_e.hermefit - numpy.polynomial.hermite_e.HermiteE.fit - numpy.polynomial.laguerre.lagfit - numpy.polynomial.laguerre.Laguerre.fit - numpy.polynomial.legendre.legfit - numpy.polynomial.legendre.Legendre.fit Also fixed erroneous links to `numpy.full` which were actually referring to the `full` argument. Changed those to code strings (double backticks) from single backticks. Also fixed formatting issues in the 3rd return value of numpy.polyfit (and hence also numpy.ma.polyfit).
* | | Merge pull request #19917 from BvB93/arraysetopsCharles Harris2021-09-211-9/+332
|\ \ \ | | | | | | | | ENH: Add annotations for `np.lib.arraysetops`
| * | | ENH: Add annotations for `np.lib.arraysetops`Bas van Beek2021-09-211-9/+332
| | | |
* | | | DOC: Add explanation of a sparse mesh grid (#19776)Tim Hoffmann2021-09-211-8/+27
| | | | | | | | | | | | | | | | | | | | * Add explanation of a spare mesh grid. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | | | DOC: Typos found by codespellDimitri Papadopoulos2021-09-214-5/+5
|/ / /
* | | MAINT: Replace the old `_NestedSequence` union and remove `_RecursiveSequence`Bas van Beek2021-09-196-20/+18
|/ /
* | MAINT: Improve ``_median_nancheck`` docstring.Charles Harris2021-09-141-1/+1
| |
* | MAINT: remove unused argument in private functionMarten van Kerkwijk2021-09-142-14/+13
| |
* | BUG: ensure np.median does not drop subclass for NaN result.Marten van Kerkwijk2021-09-142-8/+16
| | | | | | | | | | | | | | | | Currently, np.median is almost completely safe for subclasses, except if the result is NaN. In that case, it assumes the result is a scalar and substitutes a NaN with the right dtype. This PR fixes that, since subclasses like astropy's Quantity generally use array scalars to preserve subclass information such as the unit.
* | MAINT: Make parameters match label.Charles Harris2021-09-131-1/+1
| |
* | TST: Fix a couple of `pytest` id labelsBas van Beek2021-09-131-3/+3
| | | | | | | | Co-Authored-By: Charles Harris <charlesr.harris@gmail.com>
* | TST: Expand/rewrite the `test_allnans` testsBas van Beek2021-09-111-79/+115
| | | | | | | | Parametrize w.r.t. the axis, array dimensionality and dtype
* | BUG: Fixed an issue wherein `nanpercentile` and `nanquantile` would ignore ↵Bas van Beek2021-09-111-1/+2
| | | | | | | | the dtype for all-nan arrays
* | TST: Expand `TestNanFunctions_NumberTypes` with 0d arraysBas van Beek2021-09-091-12/+17
| |
* | TST: Make nanfunc test ignore overflow instead of xfailing testSebastian Berg2021-09-071-3/+1
| | | | | | | | | | | | This makes the test more precise, and I ran into having to broaden the xfails otherwise, because right now reduce-likes incorrectly faile to give floating point warnings (and I was fixing that).
* | MAINT: Let `_remove_nan_1d` attempt to identify nan-containing object arraysBas van Beek2021-09-051-2/+4
| | | | | | | | Use the same approach as in numpy/numpy#9013
* | MAINT: Copy the `_methods._std` code-path for handling `nanstd` object-arraysBas van Beek2021-09-041-6/+3
| | | | | | | | https://github.com/numpy/numpy/blob/410a89ef04a2d3c50dd2dba2ad403c872c3745ac/numpy/core/_methods.py#L265-L270
* | TST: Add more tests for `nanmedian`, `nanquantile` and `nanpercentile`Bas van Beek2021-09-031-0/+17
| |
* | TST: Expand the old `TestNanFunctions_IntTypes` test with non-integer number ↵Bas van Beek2021-09-031-71/+52
| | | | | | | | types
* | BUG: Fixed an issue wherein certain `nan<x>` functions could fail for object ↵Bas van Beek2021-09-031-3/+20
| | | | | | | | arrays
* | Merge pull request #19815 from mwtoews/maint-ioerrorCharles Harris2021-09-024-11/+12
|\ \ | | | | | | MAINT: revise OSError aliases (IOError, EnvironmentError)
| * | MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-024-11/+12
| | |
* | | MAINT: Make the `_SupportsGetItem` protocol positional-onlyBas van Beek2021-09-021-1/+1
| | |
* | | ENH: Use custom file-like protocols instead of `typing.IO`Bas van Beek2021-09-021-17/+32
|/ /
* | Merge pull request #19781 from mwtoews/foreach-itemMatti Picus2021-09-015-33/+29
|\ \ | | | | | | MAINT: refactor "for ... in range(len(" statements
| * | MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-015-33/+29
| | |
* | | STY: Use the PEP 457 positional-only syntax in the stub filesBas van Beek2021-08-314-13/+18
| | |
* | | MAINT: Drop .pyi code-paths specific to Python 3.7Bas van Beek2021-08-309-38/+12
|/ /
* | Merge pull request #19725 from anntzer/loadtxt-fh-closingMatti Picus2021-08-261-14/+12
|\ \ | | | | | | MAINT: Use a contextmanager to ensure loadtxt closes the input file.
| * | MAINT: Use a contextmanager to ensure loadtxt closes the input file.Antony Lee2021-08-221-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | This seems easier to track that a giant try... finally. Also move the `fencoding` initialization to within the contextmanager, in the rather unlikely case an exception occurs during the call to `getpreferredencoding`.
* | | MAINT: Avoid use of confusing compat aliases.Antony Lee2021-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | As of Py3, np.compat.unicode == str, but that's not entirely obvious (it could correspond to some numpy dtype too), so just use plain str. Likewise for np.compat.int. tests are intentionally left unchanged, as they can be considered as implicitly testing the np.compat.py3k interface as well.
* | | STY: Slight style changeCharles Harris2021-08-221-1/+1
| | |
* | | PERF: Optimize loadtxt usecols.Antony Lee2021-08-221-10/+15
|/ / | | | | | | | | | | 7-10% speedup in usecols benchmarks; it appears that even in the single-usecol case, avoiding the iteration over `usecols` more than compensates the cost of the extra function call to usecols_getter.
* | Merge pull request #19693 from anntzer/loadtxtinlinereaddataCharles Harris2021-08-221-33/+18
|\ \ | | | | | | MAINT: In loadtxt, inline read_data.
| * | MAINT: In loadtxt, inline read_data.Antony Lee2021-08-171-33/+18
| | | | | | | | | | | | | | | | | | No speed difference; the point is to avoid an unnecessary inner generator (which was previously defined quite far away from its point of use).
* | | DOC: Fix typo in `unwrap` docstring.Ghiles Meddour2021-08-171-1/+1
|/ /
* | Merge pull request #19627 from ankitdwivedi23/ankitd/vectorize-ignore-whitespaceCharles Harris2021-08-162-0/+17
|\ \ | | | | | | BUG: Ignore whitespaces while parsing gufunc signatures