summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #7432 from charris/backport-7363Charles Harris2016-03-192-19/+20
|\ | | | | Backport 7363, ENH: Make no unshare mask future warnings less noisy
| * ENH: Make no unshare mask future warnings less noisySebastian Berg2016-03-192-19/+20
| | | | | | | | | | Incorporates Nathaniels suggestions for a longer explanation in the release notes.
* | MAINT: Cleanup of backport of PRs #7416, #7423Joseph Fox-Rabinovitz2016-03-162-73/+101
| |
* | BUG: Ongoing fixes to PR#7416Joseph Fox-Rabinovitz2016-03-162-2/+2
| | | | | | | | | | 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-27/+64
| | | | | | | | | | 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-162-96/+255
|/ | | | | Fixes #7411. Tests and documentation updated. Fixes other small issues with range and bin count computations.
* TST: Check that result of corrcoef are clipped.Charles Harris2016-03-141-3/+12
| | | | | | This doesn't actually test much, as we don't have any inputs where that was not already the case. But at least it is there and perhaps a fuzz test can be added at a later date.
* MAINT/BUG: Clip real and imag parts of corrcoef return to [-1, 1].Charles Harris2016-03-141-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.
* Merge pull request #7412 from charris/backport-7407Charles Harris2016-03-122-3/+30
|\ | | | | Backport 7407, BUG: Fix decref before incref for in-place accumulate
| * BUG: Fix decref before incref for in-place accumulateSebastian Berg2016-03-122-3/+30
| | | | | | | | closes gh-7402
* | BUG: incorrect type for objects whose __len__ failsAllan Haldane2016-03-092-0/+17
|/ | | | Fixes #7393
* Merge pull request #7324 from charris/revert-vectorizations-for-1.11.xCharles Harris2016-02-273-168/+35
|\ | | | | Revert some ufunc vectorizations for 1.11.x
| * Revert "Merge pull request #6980 from juliantaylor/vect-isfinite"Charles Harris2016-02-233-168/+35
| | | | | | | | | | | | | | | | | | | | This reverts commit 3a92c549220807ce0a3e91b7e4441bff61a56384, reversing changes made to 8a1c58201ca15168c8346c26522aa5c2bf8dc9c1. Second of two reversions to undo vectorization of isinf, isnan, and signbit for Numpy 1.11.0. The changes led to test failures on windows for Python 2.6. Because Python 2.6 will not be supported by Numpy 1.12, this does not need to be done for current master.
| * Revert "Merge pull request #6994 from juliantaylor/signbit"Charles Harris2016-02-231-4/+4
| | | | | | | | | | | | | | | | | | | | This reverts commit 4b82b1bba72ef7539c06a4577b7102da9564ca02, reversing changes made to 3a9c90cbfd6057e9f124f3d31b82f8c0ad22cd20. First of two reversions to undo vectorization of isinf, isnan, and signbit for Numpy 1.11.0. The changes led to test failures on windows for Python 2.6. Because Python 2.6 will not be supported by Numpy 1.12, this does not need to be done for current master.
* | Merge pull request #7337 from jakirkham/kf_test_datetimeCharles Harris2016-02-251-0/+1
|\ \ | | | | | | TST: Mark datetime test as a known failure on Python's below 2.7.
| * | TST: Mark datetime test as a known failure on Python's below 2.7.John Kirkham2016-02-251-0/+1
| |/ | | | | | | | | | | | | Appears that there is an attribute used by this test, `total_seconds` of `timedelta` objects that is not introduced until Python 2.7. So, this does not exist on Python 2.6. Here we mark this test as a known failure on Python's below 2.7.
* | TST: fix MemoryError on win32Christoph Gohlke2016-02-241-0/+4
|/
* Merge pull request #7298 from charris/backport-7296Charles Harris2016-02-212-6/+29
|\ | | | | Backport 7296, Revert part of #3907 which incorrectly propogated MaskedArray info.
| * Revert part of #3907 which incorrectly propogated MaskedArray info.Marten van Kerkwijk2016-02-202-6/+29
| |
* | DOC: Document that floor_divide and remainder are complementary.Charles Harris2016-02-201-7/+11
| | | | | | | | | | The floor_divide (//) and remainder (%) functions are complementary in the sense that a ~= (a % b) + (a // b).
* | TST: Add tests for '//' and '%' (floor_divide, remainder).Charles Harris2016-02-203-44/+170
| | | | | | | | | | Add tests for some corner cases involving inf, zero, and nan. Check that small integers are handled exactly.
* | ENH: Make numpy ufuncs compatible with Python divmod.Charles Harris2016-02-201-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following numpy ufuncs are reimplemented using the npy_divmod function. - remainder ('%') - floor_divide ('//') Example of differences Currently In [1]: a = np.array(78 * 6e-8) In [2]: b = np.array(6e-8) In [3]: a // b Out[3]: 77.0 In [4]: a % b Out[4]: 5.9999999999999651e-08 Previously In [1]: a = np.array(78 * 6e-8) In [2]: b = np.array(6e-8) In [3]: a // b Out[3]: 78.0 In [4]: a % b Out[4]: 0.0 The first agrees with the Python values for the same operation and is a bit more accurate for the input values as represented internally. Closes #7224.
* | MAINT: Remove floor function code no longer needed in scalarmath.Charles Harris2016-02-201-21/+0
| | | | | | | | | | The floor function is no longer needed in scalarmath as its use has been replaced by the new pymodf function.
* | ENH: Make numpy floating scalars consistent with Python divmod.Charles Harris2016-02-202-27/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following numpy scalar floating functions are reimplemented using the npy_divmod function. - remainder ('%') - floor_division ('//') - divmod Note that numpy scalars warn on zero division rather than raise. divmod example, Python floats In [1]: a = 78 * 6e-8 In [2]: b = 6e-8 In [3]: divmod(a, b) Out[3]: (77.0, 5.999999999999965e-08) Before this commit numpy float64 gave In [4]: divmod(float64(a), float64(b)) Out[4]: (78.0, 0.0) After this commit numpy float64 gives In [4]: divmod(float64(a), float64(b)) Out[4]: (77.0, 5.9999999999999651e-08)
* | ENH: Add new npy_divmod function to npy_math.Charles Harris2016-02-204-0/+64
|/ | | | | | | | | | | | | | | | | The new function is taken from the Python version of float_divmod and computes the result of floor_division and modulus together so that they can be kept compatible. This should also result in the '//' and '%' operators applied to np.float64 and Python float returning the same values. The intent is to implement the ufuncs floor_divide and remainder using the npy_divmod so that their results will also match those of '//' and '%' while providing consistency between the two. Note that npy_divmod uses fmod, which is very slow. As a result, the floor_division and remainder functions are about 4x slower than the previous versions based on the floor function, but should be more accurate.
* Merge pull request #7290 from charris/backport-7266Charles Harris2016-02-194-53/+22
|\ | | | | Backport #7266, BUG: Segfault for classes with deceptive __len__
| * BUG: Backport #7266, Segfault for classes with deceptive __len__Charles Harris2016-02-194-53/+22
| |
* | BUG: Make randint backwards compatible with pandasgfyoung2016-02-192-13/+28
|/ | | | | | | | The 'pandas' library expects Python integers to be returned, so this commit changes the API so that the default is 'np.int' which converts to native Python integer types when a singleton is being generated with this function.
* BUG: Enforce dtype for randint singletonsgfyoung2016-02-173-11/+20
| | | | Closes gh-7203.
* MAINT: Use VisibleDeprecationWarning for indexing deprecations.Charles Harris2016-02-144-25/+161
| | | | | | The Usual DeprecationWarning is considered too easy to ignore, so indexing is not visible to some downstream packages. Use a VisibleDeprecationWarning instead.
* Revert #6271 from charris/change-deprecated-indexes-to-errorCharles Harris2016-02-146-245/+480
| | | | | | | | | | | | | | | | | | This reverts commit 0b0206c1617841ed2e5324de752ee8ede2cce791, reversing changes made to 438cdd3d75a0bb606e7ab7f96e59744c9b78d748. This reverts all the changes of indexing deprecation warnings to errors that were done prior to branching Numpy 1.11.x. It is easier to make a clean reversion here than to pick out those bits involving integer indexing specifically. As the aim of this reversion is to give downstream projects a bit more time to adapt I don't think the slight overkill is worth worrying about, especially if downstream projects start paying close attention to deprecations. The 1.11.0-notes also need updating, but I will submit a separate PR against master for that. Closes #7162.
* TST: Drop `FutureWarning` filters from tests where they were added.John Kirkham2016-02-091-8/+0
|
* BUG: Raise a quieter `MaskedArrayFutureWarning` for mask changes.John Kirkham2016-02-091-14/+17
| | | | | | | Drop the `__getitem__` warning. In `__setitem__` check to see if the masked array is shared. If it is shared, we know it will propagate upstream in the future. Also, use a more specific warning type instead of using `FutureWarning` so that this can be explicitly ignored.
* Improve invalid slice error messages in 1.11Nathaniel J. Smith2016-02-091-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Thanks to c87c7a612ee7f9, invalid slices in 1.11 have started raising exceptions like (example from the scikit-learn test suite): ``` File ".../sklearn/feature_selection/univariate_selection.py", line 407, in _get_support_mask kept_ties = ties[:max_feats - mask.sum()] IndexError: invalid index ``` This makes the minimal changes so the error message becomes: ``` File ".../sklearn/feature_selection/univariate_selection.py", line 407, in _get_support_mask kept_ties = ties[:max_feats - mask.sum()] IndexError: failed to coerce slice entry of type numpy.float64 to integer ``` For master we should just dike out all this custom coercion logic and replace it with a call to `PySlice_GetIndicesEx`, but that changes exception types and other stuff that I don't want to risk during the beta period, so this is a minimal fix submitted against 1.11 directly (!!).
* Merge pull request #7205 from charris/backport-7180Charles Harris2016-02-072-2/+6
|\ | | | | Backport 7180, BUG: Fixed previous attempt to fix dimension mismatch in nanpercentile
| * BUG: Fixed previous attempt to fix dimension mismatch in nanpercentileJoseph Fox-Rabinovitz2016-02-072-2/+6
| | | | | | | | | | | | | | | | | | nanpercentile was conforming to dimension convention of percentile incorrectly. percentile outputs results for the different percentiles along the first dimension of the output. nanpercentile was moving the reduction axis to the front using swapaxes, which would move the first axis out of place if there were more than two in the array. Added a test with more than two axes to demonstrate and used rollaxis instead of swapaxes to do the interhange.
* | Merge pull request #7206 from charris/backport-7181Charles Harris2016-02-073-136/+147
|\ \ | | | | | | Backport 7181, 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-073-136/+147
| |/
* | BUG: raise IOError on not a file in python2Julian Taylor2016-02-073-3/+15
|/ | | | | | | The change in 5225e4c2007 did not account for PyFile_AsFile does not raise an error on invalid input, add the handling to equalize our wr5225e4c2007 apper function. closes gh-7200
* TST: Backport #7171gfyoung2016-02-021-4/+14
|
* TST: Backport #7116gfyoung2016-02-021-1/+7
|
* BUG: Fixed 'midpoint' interpolation of np.percentile in odd cases.Mad Physicist2016-02-012-4/+8
| | | | Backport of #7129
* Merge pull request #7160 from charris/backport-7145Charles Harris2016-01-312-4/+20
|\ | | | | Backport 7145, 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-312-4/+19
| | | | | | | | Added unit tests for these conditions.
* | Reascertain that linspace respects ndarray subclasses in start, stop.Marten van Kerkwijk2016-01-312-4/+22
|/
* Merge pull request #7154 from charris/backport-7149Charles Harris2016-01-311-1/+1
|\ | | | | Backport 7149, TST: Add missing suffix to temppath manager
| * TST: Add missing suffix to temppath managerSebastian Berg2016-01-311-1/+1
| | | | | | | | | | Without the suffix, np.save creates a new file and the file does not get cleaned up.
* | Merge pull request #7157 from gfyoung/backport-7119Charles Harris2016-01-311-1/+1
|\ \ | | | | | | BUG: Backport #7119
| * | BUG: Backport #7119gfyoung2016-01-311-1/+1
| | |