summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4454 from jurnix/namedargsJulian Taylor2014-06-081-4/+9
|\ | | | | ENH: apply_along_axis accepts named arguments
| * PEP8 nitpicksjurnix2014-06-061-4/+7
| |
| * ENH: apply_along_axis accepts named argumentsAlbert2014-03-271-4/+6
| |
* | BUG: Fixed piecewise function for 0d inputJuan Luis Cano Rodríguez2014-06-082-20/+22
| | | | | | | | | | | | | | | | | | | | When `x` has more than one element the condlist `[True, False]` is being made equivalent to `[[True, False]]`, which is correct. However, when `x` is zero dimensional the expected condlist is `[[True], [False]]`: this commit addresses the issue. Besides, the documentation stated that there could be undefined values but actually these are 0 by default: using `nan` would be desirable, but for the moment the docs were corrected. Closes #331.
* | BUG: Correct behavior for lists of tuples in unique, closes #4785jaimefrio2014-06-062-7/+11
| | | | | | | | | | | | | | | | 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`.
* | TST: add a format 2.0 roundtrip testJulian Taylor2014-06-031-0/+7
| |
* | BUG: fix test deleting temporary file before using it on windowsJulian Taylor2014-06-031-22/+28
| | | | | | | | | | | | | | The version check was not valid for python3, though the whole logic can be removed with a finally clause. This requires that the savez tests need to cleanup the NpyzFile results which still hold an open file descriptor.
* | Merge pull request #4760 from juliantaylor/masked-medianCharles Harris2014-06-022-2/+36
|\ \ | | | | | | ENH: rewrite ma.median to improve poor performance for multiple dimensions
| * | ENH: use masked median for small multidimensional nanmediansJulian Taylor2014-06-022-2/+36
| | |
* | | Merge pull request #4765 from juliantaylor/npyformat-2.0Charles Harris2014-06-022-34/+194
|\ \ \ | | | | | | | | ENH: add storage format 2.0 with 4 byte header size
| * | | ENH: add storage format 2.0 with 4 byte header length sizeJulian Taylor2014-06-022-34/+194
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new format only increases the header length field to 4 bytes. allows storing structured arrays with a large number of named columns. The dtype serialization for these can exceed the 2 byte header length field required by the 1.0 format. The generic functions automatically use the 2.0 format if the to be stored data requires it. To avoid unintentional incompatibilies a UserWarning is emitted when this happens. If the format is not required the more compatible 1.0 format is used. Closes gh-4690
* | | DOC: Fix indentation and add missing blank lines for meshgrid doc.Charles Harris2014-06-021-4/+7
|/ /
* | DOC: add versionadded tags to meshgrid argumentsJulian Taylor2014-06-021-0/+3
| | | | | | | | [ci skip]
* | TST: fix random failing histogram testJulian Taylor2014-05-301-1/+1
| | | | | | | | | | histogramdd rounds by decimal=6 so the random numbers may not be outliers if they are below 1. + 1e6
* | MAINT: Removed code emulating keepdims in covDavid Freese2014-05-301-4/+2
| |
* | BUG: Don't let meshgrid ignore unknown kwargs. Fixes #4755.Michael McNeil Forbes2014-05-302-3/+14
| |
* | Merge pull request #4749 from seberg/0d-nanperc-outJulian Taylor2014-05-292-65/+95
|\ \ | | | | | | BUG: nanpercentile 0-d with output given.
| * | BUG: nanpercentile/nanmedian 0-d with output given.Sebastian Berg2014-05-282-65/+95
| | | | | | | | | | | | Also some PEP-8 fixes and test improvements
* | | Merge pull request #4750 from jaimefrio/tri-styseberg2014-05-281-4/+2
|\ \ \ | |/ / |/| | STY: Use `.astype`'s `copy` kwarg in `np.tri`
| * | STY: Use `.astype`'s `copy` kwarg in `np.tri`jaimefrio2014-05-271-4/+2
| | | | | | | | | | | | Replace an explicit type check with setting `copy=False` in call to `astype`.
* | | DOC: clarify savetxt delimiter and newline docstringJulian Taylor2014-05-261-2/+2
| | | | | | | | | newline and delimiter can be strings not only single characters
* | | Merge pull request #4574 from ggventurini/masterJulian Taylor2014-05-261-1/+2
|\ \ \ | |/ / |/| | DOC: Docstring fix for `savetxt` (minor change)
| * | Docstring fix for `savetxt`ggventurini2014-04-011-1/+2
| | |
* | | ENH: added functionality nanpercentile to numpyDavid Freese2014-05-222-1/+263
| | | | | | | | | | | | | | | | | | Implemented a nanpercentile and associated tests as an extension of np.percentile to complement the other nanfunctions.
* | | ENH: Add the scipy NumpyVersion class.Charles Harris2014-05-153-0/+213
| | | | | | | | | | | | | | | The class is in numpy/lib/_version.py and can be used to compare numpy versions when the version goes to double digits.
* | | Merge pull request #4307 from dfreese/feature/nanmedianJulian Taylor2014-05-062-6/+238
|\ \ \ | | | | | | | | ENH: added functionality nanmedian to numpy
| * | | ENH: added functionality nanmedian to numpyDavid Freese2014-05-022-6/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented a nanmedian and associated tests as an extension of np.median to complement the other nanfunctions Added negative values to the unit tests Cleaned up documentation of nanmedian
* | | | MAINT: Comparison deprecation followup fixesSebastian Berg2014-05-041-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the identity check `a = np.array([np.nan], dtype=object)` `a == a`, etc. a deprecation/futurewarning instead of just changing it. Also fixes some smaller things.
* | | | DEP: Deprecate that comparisons ignore errors.Sebastian Berg2014-05-041-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means that for example broadcasting errors get raised. The array_equiv function is changed to explicitely test if broadcasting is possible. It may be nice to do this test differently, but I am not sure if that is possible. Create a FutureWarning for comparisons to None, which should result in areal elementwise (object) comparisons. Slightly adepted a wrong test. Poly changes: Some changes in the polycode was necessary, the one is probably a bug fix, the other needs to be thought over, since len check is not perfect maybe, since it is more liekly to raise raise an error. Closes gh-3759 and gh-1608
* | | | DOC/FIX: Fix error in documentationYoshiki Vázquez Baeza2014-05-041-4/+0
|/ / / | | | | | | | | | | | | | | | | | | Remove misleading note about equivalency betwen column_stack and np.vstack(tup).T. Fixes #3488
* | | Add tests using matricesMarten van Kerkwijk2014-04-221-0/+25
| | |
* | | BUG: incorrect argument order to _copyto in in np.nanmax, np.nanminMarten van Kerkwijk2014-04-201-2/+2
| | |
* | | ENH: add a 'return_counts=' keyword argument to `np.unique`jaimefrio2014-04-052-37/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | ENH: Better error w/ line num for bad column count in np.loadtxt()Daniel da Silva2014-04-052-2/+18
|/ / | | | | | | Resolves #2591. Adds more explicit error handling in line parsing loop.
* | ENH: Replace exponentiation with cumulative product in np.vanderjaimefrio2014-03-311-25/+27
| | | | | | | | | | Speeds calculation up by ~3x for 100x100 matrices, and by ~45x for 1000x1000
* | Merge pull request #3830 from jarondl/recfromcsvCharles Harris2014-03-282-10/+21
|\ \ | | | | | | MAINT (API?): organize npyio.recfromcsv defaults
| * | STY: change and delete some comments in recfromcsvjarondl2014-03-121-5/+1
| | | | | | | | | | | | | | | Removed two irrelevant comments about code history. P.S. my first try with Github's online editor.
| * | DOC: npyio.recfromcsv keyword argument changesYaron de Leeuw2014-02-281-0/+5
| | | | | | | | | | | | | | | | | | Added a note to recfromcsv about the `dtype` keyword, as suggested by @hpaulj. Also added a note to the release notes, about the change in the `update` keyword, as suggested by @charris.
| * | TST: Added regression test for recfromcsv dtype error, as suggested by @hpauljYaron de Leeuw2014-02-281-0/+8
| | |
| * | MAINT (API?): organize npyio.recfromcsv defaultsYaron de Leeuw2014-02-281-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Organizes the default kwargs in recfromcsv. Changes two undocumented kwargs behaviors: * previously, if a user set `names=None`, it was ignored and replaced with `names=True` * the `dtype` kwarg was ignored. If `update` was given, it was used as `dtype`, and if not, None was used. We can retain the `update` behavior by using `kwargs.setdefault("dtype",kwargs.get('update', None))`. This Closes #311 .
* | | ENH: use smallest integer for tri rangesJulian Taylor2014-03-271-2/+17
| | | | | | | | | | | | reduces buffer copy and comparison overhead for boolean outer product
* | | Merge pull request #4542 from immerrr/fix-bincount-systemerrorCharles Harris2014-03-262-16/+32
|\ \ \ | | | | | | | | BUG: fix some errors raised when minlength is incorrect in np.bincount
| * | | BUG: fix incorrect minlength handling in np.bincountimmerrr2014-03-262-16/+32
| | | |
* | | | Merge pull request #4509 from jaimefrio/twodim-speedupJulian Taylor2014-03-262-26/+80
|\ \ \ \ | |/ / / |/| | | ENH: speed-up of triangular matrix functions
| * | | ENH: speed-up of triangular matrix functionsjaimefrio2014-03-252-26/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `np.tri` now produces less intermediate arrays. Runs about 40% faster for general dtypes, up to 3x faster for boolean arrays. * `np.tril` now does smarter type conversions (thanks Julian!), and together with the improvements in `np.tri` now runs about 30% faster. `np.triu` runs almost 2x faster than before, but still runs 20% slower than `np.tril`, which is an improvement over the 50% difference before. * `np.triu_indices` and `np.tril_indices` do not call `np.mask_indices`, instead they call `np.where` directly on a boolean array created with `np.tri`. They now run roughly 2x faster. * Removed the constraint for the array to be square in calls to `np.triu_indices`, `np.tril_indices`, `np.triu_indices_from` and `np.tril_indices_from`.
* | | | Merge pull request #4358 from seberg/fast-selectCharles Harris2014-03-242-32/+121
|\ \ \ \ | | | | | | | | | | ENH: Speed improvements and deprecations for np.select
| * | | | ENH: Speed improvements and deprecations for np.selectSebastian Berg2014-03-232-32/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea for this (and some of the code) originally comes from Graeme B Bell (gh-3537). Choose is not as fast and pretty limited, so an iterative copyto is used instead. Closes gh-3259, gh-3537, gh-3551, and gh-3254
* | | | | DOC: Link convolve with polymulendolith2014-03-221-0/+2
| | | | | | | | | | | | | | | | | | | | Matlab uses `conv` for both convolution and polynomial multiplication. Clarifying that numpy has functions for each.
* | | | | TST: add unittest for byte_boundsOlivier Grisel2014-03-191-0/+9
| | | | |
* | | | | FIX: missing asarray import in numpy.libs.utilsOlivier Grisel2014-03-191-1/+1
| | | | |