Age | Commit message (Collapse) | Author | Files | Lines |
|
Depending on the input, this would return:
* A single slice, if mask=nomask
* A list of slices, if mask is an array
* None, if mask is fully masked
The documented return value is a list, and all downstream callers of this
function end up having to correct for it not being one.
This affects the result of np.ma.notmasked_contiguous, which also did not
document these unusual return values.
|
|
|
|
[ci skip]
|
|
|
|
|
|
Uses '_fromnxfunction_seq' just like 'vstack', 'hstack', etc.
Added release note to 1.15.0.
|
|
Fixes gh-9233
|
|
This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
|
|
|
|
Bare except is very rarely the right thing
|
|
|
|
Also adds a test for the disabled-by-design behaviour - this would return
raw matrices, not masked arrays
|
|
This fixes gh-8331
Also update the docs for arraysetops to remove the outdated "1D" from the
description, which was already incorrect for np.unique.
|
|
This fixes an omission where duplicate axes would only be detected when positive
|
|
return nan as it did in 1.11 and same as normal median.
closes gh-8703
|
|
This code was only here for Python 2.5 compatibility, but numpy requires 2.7
at minimum
|
|
the masked nans which are equivalent to valid infs must be replaced
with infs earlier otherwise the inf is lost in the masked sum of the low
and high part.
Closes gh-8487
|
|
|
|
For such arrays, the sum of the two entries closest to the middle was
not divided by 2. Now fixed, with test cases adapted to ensure this
stays OK.
|
|
This requires to base masked median on sort(endwith=False) as we need to
distinguish Inf and NaN.
Using Inf as filler element of the sort does not work as then the mask is not
guaranteed to be at the end.
Closes gh-8340
Also fixed 1d ma.median not handling np.inf correctly, the nd variant
was ok.
|
|
and an axis argument. Add test.
|
|
|
|
they used to be called `..._w_...` and `..._wo_...`.
|
|
In some places, just remove aparently unnecessary filters.
After this, all cases of ignore filters should be removed from
the tests, making testing (even multiple runs) normally fully
predictable.
|
|
|
|
|
|
Fixes #5969.
Performance fix #4760 had caused wrong shaped results in the 1D case.
This fix restores the original 1D behavior.
|
|
The MaskedArray.data attribute is unreliable for tests because it can
contain arbitraty junk data at masked positions. Instead, all
MaskedArray tests should look at marr.filled(0) to check if we got the
same result.
|
|
This reverts commit 7141f40b58ed1e7071cde78ab7bc8ab37e9c5983,
reversing changes made to 8fa6e3bef26a6d4a2c92f2824129aa4409be2590.
The original broke some pandas tests. The current plan to get this
in is
* reversion
* issue FutureWarning in 1.11 and 1.12
* make the change in 1.13.
|
|
Now, NaT compares like NaN:
- NaT != NaT -> True
- NaT == NaT (and all other comparisons) -> False
We discussed this on the mailing list back in October:
https://mail.scipy.org/pipermail/numpy-discussion/2015-October/073968.html
|
|
Test that ma.dot always returns a masked array.
Test basic that the new out parameter in ma.dot works.
|
|
The np.ma.atleast_1d, np.ma.atleast_2d, np.ma.atleast_3d and np.ma.diagflat
function return arrays when given a scalar in the same manner as their non-ma
counterparts. Previously these function would return None.
Additionally, the np.ma vstack, row_stack, hstack, column_stack, dstack, and
hsplit functions now raise an expection when given a scalar argument.
closes #3367
|
|
The worst case of alternating masked iterated all boundaries and sliced
half away, improve this by only iterating the needed half of the
boundary index array.
|
|
Also fix "*" imports.
The formatting of test arrays is not fixed for multiple spaces following
"," and other violations that are common in tests. To be precise, E241
and E201 are added to the errors that are excluded.
|
|
Fixes #5846 (If called with an empty array as first argument, the returned
array had dtype bool instead of the dtype of the input array)
|
|
Provides a way to supress slices along an abitrary tuple of dimensions.
|
|
The bias and ddof arguments had no effect on the calculation of the
correlation coefficient because the value cancels in the calculation.
Deprecate these arguments to np.corrcoef and np.ma.corrcoef.
|
|
This fixes the incorrect handing of masked NaNs by
``np.ma.polyfit``. Instead of passing the mask into
``np.polyfit`` by setting the weight of the masked
points to zero, the subset of elements of which are
to be fitted are passed instead.
Closes #5591
|
|
ndarrays have a data attribute pointing to the data buffer which leads
to the median working on a byte view instead of the actual type.
closes gh-5424
|
|
There are two issues:
A masked divide of an infinite value is a masked value which means one
can't use np.ma.mean to compute the median as infinity division is well
defined.
This behaviour seems wrong to me but it also looks intentional so
changing it is not appropriate for a bugfix release.
The second issue is that the ordering of the sorted masked array is
undefined for equal values, the sorting considers infinity the largest
floating point value which is not correct in respect to sorting where
nan is considered larger. This is fixed by changing the
minimum_fill_value to nan for float data in the masked sorts.
Closes gh-5138
|
|
ENH: apply_along_axis accepts named arguments
|
|
many masked median along a small dimension is extremely slow due to the
usage of apply_along_axis which iterates fully in python. The unmasked
median is about 1000x faster.
Work around this issue by using indexing to select the median element
instead of apply_along_axis.
Further improvements are possible, e.g. using the current np.nanmedian
approach for masked medians along large dimensions so partition is used
instead of sort or to extend partition to allow broadcasting over
multiple elements.
Closes gh-4683.
|
|
Masked arrays version of apply_over_axes did not apply
function correctly to arrays with non-trivial masks.
Fixes #4461.
|
|
|
|
|
|
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
|
|
|
|
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|