summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | |
* | | TST: add some more testsJulian Taylor2014-03-171-0/+10
| |/ |/| | | | | | | test for gh-4494 test median returns array scalars and works with object arrays
* | Merge pull request #4498 from meltingwax/meltingwax/2092Charles Harris2014-03-151-1/+1
|\ \ | | | | | | DOC: specify that 2d array must be non-empty in np.poly error message.
| * | DOC: specify that 2d array must be non-empty in np.poly error message.Daniel da Silva2014-03-151-1/+1
| | | | | | | | | | | | Fixes #2092. Changes message passed to ValueError.
* | | MAINT: revert back to separate median implementationJulian Taylor2014-03-132-66/+126
| | | | | | | | | | | | | | | | | | Merging median and percentile make would break astropy and quantities as we don't call mean anymore. These packages rely on overriding mean to add their own median behavior.
* | | ENH: add extended axis and keepdims support to median and percentileJulian Taylor2014-03-132-69/+231
| | |
* | | Merge pull request #4479 from leomao/masterCharles Harris2014-03-122-4/+9
|\ \ \ | | | | | | | | BUG: when initialize a vectorize object, always set self._ufunc to None first. fix #3285.
| * | | remove assert in _get_ufunc_and_otypes, add a test in test_function_base.pyLeoMao2014-03-122-3/+9
| | | |
| * | | when initialize a vectorize object, always set self._ufunc to None first. ↵LeoMao2014-03-111-2/+1
| | | | | | | | | | | | | | | | fix #3285
* | | | ENH: release gil for np.packbits and np.unpackbitsJulian Taylor2014-03-111-0/+10
| | | |
* | | | Merge pull request #4428 from jarondl/genfromtxt-docCharles Harris2014-03-041-2/+10
|\ \ \ \ | | | | | | | | | | DOC: add missing parameters to npyio.genfromtxt, fix #2929
| * | | | DOC: two minor typos in genfromtxtjarondl2014-03-041-2/+2
| | | | |
| * | | | DOC: add missing parameters to npyio.genfromtxt, fix #2929Yaron de Leeuw2014-03-031-1/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | `loose` `missing` and `skiprows` were missing from the docstring of `npyio.genfromtxt`. The later two are actualy deprecated, but were added nonetheless.
* | | | Merge pull request #4430 from juliantaylor/apply-over-docCharles Harris2014-03-041-0/+13
|\ \ \ \ | |_|_|/ |/| | | DOC: document equivalence of apply_over_axes and tuple axis ufuncs
| * | | DOC: document equivalence of apply_over_axes and tuple axis ufuncsJulian Taylor2014-03-041-0/+13
| |/ /
* | | BUG: fix ValueError for byte_bounds() on datetime arraymosessky2014-03-021-2/+3
|/ / | | | | | | close gh-4345
* | Merge pull request #4377 from ContinuumIO/as_strided_fixCharles Harris2014-03-012-1/+19
|\ \ | | | | | | Fix stride_stricks.as_strided function for object arrays
| * | Fix stride_stricks.as_strided function for object arraysJay Bourque2014-02-262-1/+19
| | | | | | | | | | | | Currently, calling as_strided for object array results in 'TypeError: Cannot change data-type for object array.'. Fix so that dtype of new array is only set for void dtype, as originally intended.
* | | Merge pull request #4372 from charris/fix-gh-2423Charles Harris2014-03-012-109/+113
|\ \ \ | | | | | | | | DOC: Fix documentation of normed keyword in histogram2d and histogramdd.
| * | | DOC: Fix documentation of normed in histogram2d and histogramdd.Charles Harris2014-02-262-109/+113
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation misrepresented what happened, leaving out division by the total number of sample points. Also run spellcheck over function_base.py and twodim_base.py and break some long lines. Closes #2423.
* | | Merge pull request #4376 from charris/fix-gh-2807Charles Harris2014-03-011-14/+18
|\ \ \ | | | | | | | | DOC: Improve the documentation of numpy.load.
| * | | DOC: Improve the documentation of numpy.load.Charles Harris2014-02-261-14/+18
| |/ / | | | | | | | | | | | | | | | | | | Add the fact that for pickled files, a file-like object must also support the readline() method. Closes #2807.
* | | Merge pull request #4284 from robquant/histogramdd_rightmost_binedgeJulian Taylor2014-03-012-3/+27
|\ \ \ | |_|/ |/| | Closes issue #4266, fixes histogramdd treatment of events at rightmost binedge
| * | Fix histogramdd treatment of events at rightmost binedgeRobert Franke2014-02-122-3/+27
| | | | | | | | | | | | Fixes Github issue #4266
* | | BUG: accept non arrays in cor and corrcoeffJulian Taylor2014-02-272-0/+6
| | | | | | | | | | | | closes gh-4295
* | | DOC: some versionadded notesalex2014-02-271-0/+4
| |/ |/|
* | Merge pull request #4302 from charris/fix-gh-605seberg2014-02-262-5/+21
|\ \ | | | | | | BUG: Make interp return NaN at NaN interpolation points.
| * | BUG: Make interp return NaN at NaN interpolation points.Charles Harris2014-02-162-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A NaN interpolation point was interpreted as out of bounds on the left side, hence the value of the left parameter in the function call was returned. >>> np.interp(np.nan, [-10, 10], [-2, 2]) -2.0 NaN is a better choice. Closes #605.
* | | ENH: tril and triu broadcastingalex2014-02-242-7/+31
| | |
* | | BUG: Fixes #2799jaimefrio2014-02-212-2/+5
| | | | | | | | | | | | | | | Use `np.sort` instead of `sorted` when the input is a list and no indices are requested. Fixes #2799.
* | | TST: do not use "ignore" to filter warningsSebastian Berg2014-02-212-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a warning is ignored (or raised once) in python, the warnings module will tag on a `__warningregistry__` dictionary to be able to filter these warnings in the future. This is tagged on to the current context, causing leakage to later calls (this is a bit more complex, since where the registry ends up depends on the layers between the original caller and warner). In short, tests should typically not use ignore but catch the warnings to avoid changing the user experience (or errors on duplicate test runs). Fixes an error on duplicate test runs (does not remove all "ignores" which may change behaviour outside tests). Closes gh-4340
* | | Merge pull request #4316 from charris/fix-gh-4092seberg2014-02-181-3/+3
|\ \ \ | | | | | | | | DOC: Remove \n from strings in plot examples.
| * | | DOC: Remove \n from strings in plot examples.Charles Harris2014-02-171-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | The \n occur in plot titles and mess up the generated html. An alternative fix would be to use a raw docstring or \\n, but here it looks simpler to just delete the problem. Closes #4092.
* | | DOC: Document that fliplr only works on 2-D arrays.Charles Harris2014-02-161-3/+2
|/ / | | | | | | | | | | Docstring claimed 2-D was not required, but it is. Fix that. Closes #3332.
* | Merge pull request #4257 from juliantaylor/tostring-deprCharles Harris2014-02-141-2/+2
|\ \ | | | | | | ENH: add tobytes and stop using tostring in documentation
| * | ENH: add tobytes and stop using tostring in documentationJulian Taylor2014-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | tostring returns bytes which are not equal to string, so provide a tobytes function alias. tostring does not emit a deprecation warning yet so rdepends do not need to check two names to support older versions of numpy without warnings.
* | | DOC: Fix typo in a dsplit() error message.Chris Ball2014-02-131-1/+1
| |/ |/|
* | MANT: separated initial assignment for `min` and `max`jaimefrio2014-02-111-2/+2
| |
* | ENH: single pass over array in `bincount` to determine output sizejaimefrio2014-02-111-30/+18
| | | | | | | | | | | | | | | | | | | | | | | | `bincount` checks its input array to make sure there are no negative entries, and to determine the size of the output array. This is done by calling two different functions, each having to loop over the whole array. This PR adds a new function, `minmax`, that computes the minimum and maximum of the array in a single pass over it. This leads to speed-ups peaking at 1.5x, with typical values for large arrays around 1.15x - 1.25x. A full benchmark summary of the new implementation, including a supposedly more efficient algorithm that turned out to run slower, can be found [here](https://gist.github.com/jaimefrio/8743836).
* | Merge pull request #4247 from jaimefrio/digitize-monotonicCharles Harris2014-02-112-12/+41
|\ \ | | | | | | BUG: check for monotonic bin arrays in digitize
| * | MAINT: rewrote `check_array_monotonic` following @charris suggestion tojaimefrio2014-02-111-20/+23
| | | | | | | | | | | | minimize indexing.
| * | STY: adapted code to `C_STYLE_GUIDE.rst.txt`.jaimefrio2014-02-092-22/+33
| | | | | | | | | | | | | | | | | | MAINT: rewrote `check_array_monotonic` to use array indices, not pointers. TST: tests for proper handling of bins with all items almost equal now check the return value for correctness, not just that an error is not raised.