| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Closes gh-6863.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The basic implementation of ma.dot is moved from the method to the function
and the function itself is moved from extras.py to core.py on account of
import complications. The mask_rowcols function from extras is also moved
to core.py as it is needed by dot. For backwards compatibility, both
functions are still exported in extras.__all__ and can be imported
from that module. They are not included in part of core.__all__.
An out parameter is also added to ma.dot.
This PR also closes #6611.
|
|
|
|
|
| |
Fix some long lines and indentation in numpy/ma/core.py and
numpy/ma/extras.py
|
|
|
|
|
|
|
|
|
|
|
| |
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
* Add __all__ to numpy/ma/testutils.py
* Remove various stray "#"
We might want to consider removing/refactoring both numpy/ma/bench.py
and numpy/ma/timer_comparison.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these fixes involve putting blank lines around
.. versionadded:: x.x.x
and
.. deprecated:: x.x.x
Some of the examples were also fixed.
|
|
|
|
|
|
| |
This is to make it easier to find and remove deprecated features.
It would be a good idea if all deprecations were made with similar
comments.
|
|
|
|
|
|
| |
Modified the handling that np.ma.compress_nd does of its 'axis'
argument, to more closely follow that of ufunc methods, including
error messages for wrong values.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
MaskedArray used to inherit ndarray.dot which ignored masks in the operands.
Fixes issue #5185.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\
| |
| | |
BUG: fix ma.median used on ndarrays
|
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
| |
1. Added `ma.clump_masked` and `ma.clump_unmasked` into the rst file;
2. Removed the `.extras` in the examples due to the namespace change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This consists of checking for a docstring equal to None and skipping two
tests that require docstrings.
Closes #5148.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
BUG: Masked arrays and apply_over_axes
|
| |
| |
| |
| |
| |
| |
| | |
Masked arrays version of apply_over_axes did not apply
function correctly to arrays with non-trivial masks.
Fixes #4461.
|
|\ \
| |/
|/| |
ENH: ma.asarray() and ma.asanyarray() will pass through input of the cor...
|
| |
| |
| |
| |
| |
| |
| | |
Previous implementation relied on ma.asarray() to always create
a new object.
See gh-4043.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Boolean - is not well defined, especially the unary and
binary operator are not compatible. In general boolean
minus seems to have no real application and does not do
what might be expected.
All "allclose" type functions (numpy, tests, masked) have to
now check for boolean to avoid the deprecation warning. In
the future one could think about removing it again and just
allowing the upcast.
|
|/
|
|
| |
Replace mention of variance in numpy.ma.average doc string with average.
|
| |
|
|
|
|
|
|
| |
While ddof has basically no effect on corrcoef, it exists,
but it was not passed on correctly (instead only bias would
be passed on). Fixes gh-3336
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idioms fixer makes the following replacements.
1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)
There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct. The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.
Closes #3062.
|
| |
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|\
| |
| | |
DOC: Formatting fixes using regex
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In python3 range is an iterator and `xrange` has been removed. This has
two consequence for code:
1) Where a list is needed `list(range(...))` must be used.
2) `xrange` must be replaced by `range`
Both of these changes also work in python2 and this patch makes both.
There are three places fixed that do not need it, but I left them in
so that the result would be `xrange` clean.
Closes #3092
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
Replaces the
raise Exception, msg:
form with
raise Exception(msg):
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* fixed the documentation of (flat)notmasked_xxx
|
| |
|
| |
|
| |
|