summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
Commit message (Collapse)AuthorAgeFilesLines
* BUG: distance arg of np.gradient must be scalar, fix docstringAllan Haldane2016-05-111-5/+7
| | | | | | | Fixups to docstring, and disallow non-scalars as the distance args to np.gradient. Fixes #7548, fixes #6847
* Merge pull request #7505 from ahaldane/fixup_7382Charles Harris2016-04-041-1/+2
|\ | | | | MAIN: fix to #7382, make scl in np.average writeable
| * MAIN: fix to #7382, make scl in np.average writeableAllan Haldane2016-04-041-1/+2
| |
* | DOC: link frompyfunc and vectorizeendolith2016-04-041-0/+4
|/
* BUG: Ongoing fixes to PR#7416Joseph Fox-Rabinovitz2016-03-161-1/+1
| | | | | Removed superfluous `ceil` call in automated bin width estimator. Updated tests to reflect modified estimator.
* DOC: Updated documentation to reflect changes to bin estimators.Joseph Fox-Rabinovitz2016-03-161-26/+40
| | | | | Described ad nauseum the relationship between `range` parameter and bin estimation. Updated formulas for estimators now that they are returning bin widths.
* BUG: Incorrect handling of range in `histogram` with automatic bins.Joseph Fox-Rabinovitz2016-03-161-65/+70
| | | | | Fixes #7411. Tests and documentation updated. Fixes other small issues with range and bin count computations.
* BUG: Fix string copying for np.placegfyoung2016-03-151-1/+2
| | | | | | | | | | | | | | | | Fixes bug in string copying in np.place in which replacements strings that were smaller than their replaced elements would only partially replace the element instead of the entire element. Closes gh-6974. Addendum: this commit also appears to have fixed issue with overflow for very large input arrays. Closes gh-7207.
* Merge pull request #7414 from charris/tweak-corrcoefCharles Harris2016-03-141-5/+25
|\ | | | | Tweak corrcoef
| * MAINT/BUG: Clip real and imag parts of corrcoef return to [-1, 1].Charles Harris2016-03-131-5/+19
| | | | | | | | | | | | | | | | | | | | The non-nan elements of the result of corrcoef should satisfy the inequality abs(x) <= 1 and the non-nan elements of the diagonal should be exactly one. We can't guarantee those results due to roundoff, but clipping the real and imaginary parts to the interval [-1, 1] improves things to a small degree. Closes #7392.
| * ENH: Check array dimensionality in cov function.Charles Harris2016-03-131-0/+6
| | | | | | | | | | The input arrays are documented to have ndim <=2, so check for that and raise a ValueError on failure.
* | Merge pull request #7346 from erensezener/generalized_flipCharles Harris2016-03-121-1/+73
|\ \ | |/ |/| Generalized flip
| * ENH: Add generalized flip function and its testsEren Sezener2016-03-121-1/+73
| |
* | MAINT: cleanup np.averageAllan Haldane2016-03-071-8/+13
| |
* | Maint: Removed extra space from `ureduce` Mad Physicist2016-02-261-1/+1
|/ | | This is just me being OCD. I am not sure this even merits a full commit, much less a PR, but here goes anyway.
* Merge pull request #7199 from madphysicist/histogram-estimator-dictNathaniel J. Smith2016-02-231-126/+183
|\ | | | | MAINT: Cleanup for histogram bin estimator selection
| * MAINT: Cleanup for histogram bin estimator selectionJoseph Fox-Rabinovitz2016-02-161-126/+183
| | | | | | | | | | | | Private function with superfluous checks was removed. Estimator Estimator functions are now semi-public and selection is simplified within histogram itself.
* | TST: Fixed shuffle axis in tests.Joseph Fox-Rabinovitz2016-02-221-1/+1
| | | | | | | | | | | | | | | | Since shuffle only works along the first dimension, it must be done before reshape to get reasonable looking data. Did not affect the current tests. I noticed while working on some scipy code. Also, made a couple of doc changes to np.random.shuffle.
* | BUG: Preserve array order in np.deletegfyoung2016-02-191-4/+4
|/ | | | Closes gh-7113.
* ENH: Adding support to the range keyword for estimation of the optimal ↵Varun Nayyar2016-02-131-3/+23
| | | | number of bins and associated tests
* DOC: fix up invalid LaTeX in histogram docstring.Ralf Gommers2016-02-131-20/+24
|
* Added 'doane' and 'sqrt' estimators to np.histogram in numpy.function_baseJoseph Fox-Rabinovitz2016-02-111-83/+163
|
* MAINT: Made `iterable` return a booleanJoseph Fox-Rabinovitz2016-02-101-8/+8
|
* Merge pull request #7181 from madphysicist/doc-typosCharles Harris2016-02-071-57/+64
|\ | | | | DOC: Updated minor typos in function_base.py and test_function_base.py
| * DOC: Updated minor typos in function_base.py and test_function_base.pyJoseph Fox-Rabinovitz2016-02-051-57/+64
| |
* | MAINT: Removed supurious assert in histogram estimatorsJoseph Fox-Rabinovitz2016-02-051-3/+0
|/
* Merge pull request #7129 from madphysicist/percentile-midpoint-interpolationCharles Harris2016-01-311-1/+1
|\ | | | | BUG: Fixed 'midpoint' interpolation of np.percentile in odd cases.
| * BUG: Fixed 'midpoint' interpolation of np.percentile in odd cases.Joseph Fox-Rabinovitz2016-01-311-1/+1
| | | | | | | | | | 'midpoint' must return the same as 'higher' and 'lower' when the two are the same, not 'lower' + 0.5 as it was doing.
* | Merge pull request #7145 from bastula/piecewiseCharles Harris2016-01-311-4/+9
|\ \ | | | | | | BUG: Fixed regressions in np.piecewise in ref to #5737 and #5729.
| * | MAINT: Addressed comments in PR #7145Aditya Panchal2016-01-311-2/+3
| | |
| * | BUG: Fixed regressions in np.piecewise in ref to #5737 and #5729.Aditya Panchal2016-01-291-4/+8
| | | | | | | | | | | | Added unit tests for these conditions.
* | | Merge pull request #7125 from madphysicist/percentile-docStephan Hoyer2016-01-291-42/+39
|\ \ \ | |/ / |/| | DOC: Updated documentation wording and examples for np.percentile.
| * | MAINT: Accepted all review comments for PR#7125Joseph Fox-Rabinovitz2016-01-271-7/+3
| | |
| * | DOC: Updated documentation wording and examples for np.percentile.Joseph Fox-Rabinovitz2016-01-261-39/+40
| |/ | | | | | | Examples had some factual errors. Wording updated in a couple of places.
* | MAINT: Fix some typos in a code string and commentsDongjoon Hyun2016-01-271-2/+2
|/
* DOC, MAINT: Enforce np.ndarray arg for np.put and np.placegfyoung2016-01-141-1/+5
| | | | | | | np.put and np.place do something only when the first argument is an instance of np.ndarray. These changes will cause a TypeError to be thrown in either function should that requirement not be satisfied.
* DOC: Update trapz docstring.Charles Harris2016-01-091-3/+5
| | | | [ci skip]
* DOC: fix typos in trapz()François Boulogne2016-01-091-1/+1
| | | | [ci skip]
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-4/+4
| | | | Closes gh-6863.
* DOC, MAINT: Fix the numpy.ma.cov signature and documentation.jason king2015-12-181-6/+7
| | | | The rowvar and bias parameters are booleans, not integers.
* DEP: Stricter arg checking for array orderinggfyoung2015-12-181-4/+6
| | | | | | | | | | | | | The bug traces to the PyArray_OrderConverter method in conversion_utils.c, where no errors are thrown if the ORDER parameter passed in is not of the string data-type or has a string value of length greater than one. This commit causes a DeprecationWarning to be raised, which will later be turned into a TypeError or another type of error in a future release. Closes gh-6598.
* Updated typos in histogram bin estimator equationsMad Physicist2015-12-111-2/+2
| | | In all cases, it's either ...*n^(-1/3) or .../n^(1/3), not both. The actual functions are implemented correctly.
* BUG, MAINT: check that histogram range parameters are finite, add tests to ↵lzkelley2015-11-171-3/+10
| | | | assure this. Improved some error-types.
* BUG: Make median work for empty arrays (issue #6462)Ethan Kruse2015-10-211-1/+1
| | | | | np.median([]) returns NaN. Fixes bug/regression that raised an IndexError. Added tests to ensure continued support of empty arrays.
* DOC: fix var. reference in percentile docstringTobias Megies2015-10-071-1/+1
| | | | | | | The argument for the original input array is named `a` but in the docstring it was at some point referred to as `arr`. [skip ci]
* Merge pull request #6411 from larsmans/cov-memory-useCharles Harris2015-10-051-2/+2
|\ | | | | ENH: speed up cov by ~10% for large arrays
| * ENH: speed up cov by ~10% for large arraysLars Buitinck2015-10-051-2/+2
| | | | | | | | Replaces n² divisions by one division and n² multiplications.
* | Merge pull request #6396 from rudimeier/opt-corrcoefCharles Harris2015-10-051-1/+5
|\ \ | | | | | | MAINT: corrcoef, memory usage optimization
| * | MAINT: corrcoef, memory usage optimizationRuediger Meier2015-09-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We calculate sqrt on the small vector rather than on that huge product matrix and we combine the "outer" product with element-wise devision. So even though we have a slower loop over the rows now ... this code snippet runs about 3 times faster than before. However the speed improvement of the whole function is not really significant because cov() takes 80-99% of the time (dependent on blas/lapack implementation and number of CPU cores). More important is that we will safe 1/3 memory. For example corrcoef() for a [23k, m] matrix needs 8GB now instead of 12GB.
* | | Merge pull request #6403 from larsmans/cov-memory-useJaime2015-10-041-1/+3
|\ \ \ | | |/ | |/| ENH: halve the memory requirement of np.cov