| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| | |
Backport 7363, ENH: Make no unshare mask future warnings less noisy
|
| | |
| |
| |
| |
| | |
Incorporates Nathaniels suggestions for a longer explanation
in the release notes.
|
| | | |
|
| | |
| |
| |
| |
| | |
Removed superfluous `ceil` call in automated bin width estimator.
Updated tests to reflect modified estimator.
|
| | |
| |
| |
| |
| | |
Described ad nauseum the relationship between `range` parameter and bin estimation.
Updated formulas for estimators now that they are returning bin widths.
|
| |/
|
|
|
| |
Fixes #7411. Tests and documentation updated.
Fixes other small issues with range and bin count computations.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| | |
Backport 7407, BUG: Fix decref before incref for in-place accumulate
|
| | |
| |
| |
| | |
closes gh-7402
|
| |/
|
|
| |
Fixes #7393
|
| |\
| |
| | |
Revert some ufunc vectorizations for 1.11.x
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \
| | |
| | | |
TST: Mark datetime test as a known failure on Python's below 2.7.
|
| | |/
| |
| |
| |
| |
| |
| | |
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.
|
| |/ |
|
| |\
| |
| | |
Backport 7296, Revert part of #3907 which incorrectly propogated MaskedArray info.
|
| | | |
|
| | |
| |
| |
| |
| | |
The floor_divide (//) and remainder (%) functions are complementary
in the sense that a ~= (a % b) + (a // b).
|
| | |
| |
| |
| |
| | |
Add tests for some corner cases involving inf, zero, and nan.
Check that small integers are handled exactly.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
The floor function is no longer needed in scalarmath as its use has been
replaced by the new pymodf function.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\
| |
| | |
Backport #7266, BUG: Segfault for classes with deceptive __len__
|
| | | |
|
| |/
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Closes gh-7203.
|
| |
|
|
|
|
| |
The Usual DeprecationWarning is considered too easy to ignore, so
indexing is not visible to some downstream packages. Use a
VisibleDeprecationWarning instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 (!!).
|
| |\
| |
| | |
Backport 7180, BUG: Fixed previous attempt to fix dimension mismatch in nanpercentile
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \
| | |
| | | |
Backport 7181, DOC: Updated minor typos in function_base.py and test_function_base.py
|
| | |/ |
|
| |/
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
| |
Backport of #7129
|
| |\
| |
| | |
Backport 7145, BUG: Fixed regressions in np.piecewise in ref to #5737 and #5729.
|
| | | |
|
| | |
| |
| |
| | |
Added unit tests for these conditions.
|
| |/ |
|
| |\
| |
| | |
Backport 7149, TST: Add missing suffix to temppath manager
|
| | |
| |
| |
| |
| | |
Without the suffix, np.save creates a new file and the file
does not get cleaned up.
|
| |\ \
| | |
| | | |
BUG: Backport #7119
|
| | | | |
|