| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.
1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:
* all setup.py files
* numpy/core/code_generators/generate_umath.py
* numpy/core/code_generators/generate_numpy_api.py
* numpy/core/code_generators/generate_ufunc_api.py
2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:
* core/__init__.py,
* core/numeric.py,
* core/_internal.py,
* core/arrayprint.py,
* core/fromnumeric.py,
* numpy/__init__.py,
* lib/npyio.py,
* lib/function_base.py,
* fft/fftpack.py,
* random/__init__.py
Closes #3172
|
|
|
|
|
|
|
|
| |
This should be harmless, as we already are division clean. However,
placement of this import takes some care. In the future a script
can be used to append new features without worry, at least until
such time as it exceeds a single line. Having that ability will
make it easier to deal with absolute imports and printing updates.
|
| |
|
| |
|
|
|
|
| |
assert in non-testing files that should be checked for correctness.
|
| |
|
|
|
|
| |
* fixed the documentation of (flat)notmasked_xxx
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
module. The fix should be good for Python >= 2.4 and used the following sed script:
s/\<failUnless\>/assertTrue/g
s/\<failIf\>/assertFalse/g
s/\<failUnlessEqual\>/assertEqual/g
s/\<failUnlessRaises\>/assertRaises/g
|
| |
|
| |
|
|
|
|
|
|
| |
(bugfix #1166)
extras : introduced clump_masked and clump_unmasked
|
| |
|
| |
|
|
|
|
|
|
| |
unique1d, union1d
* use np.atleast1d instead of ma.atleast1d
|
| |
|
|
|
|
|
| |
* Fixed masked_all for nested dtype
* Fixed masked_all_like for nested dtype
|
| |
|
| |
|
| |
|
|
|
|
| |
* test_extras: switched to assert_almost_equal in TestCov and TestCorrcoef
|
|
|
|
|
|
|
| |
* use self.__name__ for private method instances
extras
* fixed corrcoef
* introduced diagflat
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test
modules.
Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424.
Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments
are seen).
numpy.*.test() returns a test result object as before.
Fixed typo in distutils doc.
|
|
|
|
| |
modules.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
core:
* When creating a masked array with named fields, the mask has now a flexible type [(n,bool) for n in fields], which allows individual fields to be masked.
* When a masked array has named fields, setting the mask to a sequence of booleans will set the mask of all the fields of the corresponding record.
* A new property, recordmask, returns either the mask (when no named fields) or a boolean array where values are True if all the fields of one record are masked, False otherwise.
* A new private attribute, _isfield, has been introduced to keep track whether an array is a field of a record-like masked array or not, and make sure that the mask is properly propagated.
* Setting an existing mask to nomask will only fill the mask with False, not transform it to nomask
mrecords:
* _fieldmask is now only a synonym for _mask, kept for convenience
* revamped __getattribute__ to the example of numpy.core.records.recarray.__getattribute__
* __setslice__ and filled are now inhertied from MaskedArray
tests
* The tests in test_core have been reorganized to improve clarity and avoid duplication.
* test_extras now uses the convention "import numpy as np"
|