summaryrefslogtreecommitdiff
path: root/numpy/ma
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5149 from charris/fix-ma-docs-for-OO-optionJulian Taylor2014-10-041-3/+5
|\ \ | |/ | | | | BUG: Make numpy import when run with Python flag '-OO
| * BUG: Make numpy import when run with Python flag '-OO'.Charles Harris2014-10-031-3/+5
| | | | | | | | | | | | | | This consists of checking for a docstring equal to None and skipping two tests that require docstrings. Closes #5148.
* | Merge pull request #4905 from juliantaylor/doc-updateCharles Harris2014-07-271-0/+4
|\ \ | | | | | | documentation updates
| * | DOC: document behavior of ma.sort(endswith=) for unmasked min/max valuesJulian Taylor2014-07-271-0/+4
| |/ | | | | | | see gh-4422
* | Merge pull request #4866 from mhvk/ma/mvoid-initialisationJulian Taylor2014-07-232-5/+11
|\ \ | | | | | | BUG Masked recarray assignment with [row][record] does not work
| * | BUG Make ma[row][rec] setter work by avoiding copy in mvoid.__new__Marten van Kerkwijk2014-07-172-5/+11
| |/
* | Merge pull request #4873 from juliantaylor/masked-sort-memoryCharles Harris2014-07-161-8/+20
|\ \ | |/ | | ENH: avoid meshgrid and fancy indexing for 1d masked sort
| * ENH: avoid meshgrid and fancy indexing for 1d masked sortJulian Taylor2014-07-161-8/+20
| | | | | | | | | | Improves performance by using the simple indexing path and memory by avoiding creating a full meshgrid.
* | Merge pull request #4831 from charris/simplify-with-errstateJulian Taylor2014-06-302-4/+2
|\ \ | | | | | | MAINT: Simplify some uses of errstate context manager.
| * | MAINT: Simplify some uses of errstate context manager.Charles Harris2014-06-292-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes, e.g., with np.errstate(): np.seterr(divide='ignore') ... to with np.errstate(divide='ignore'): ...
* | | MAINT: Use an unqualified nomask variable in ma.core.Lev Abalkin2014-06-301-1/+1
|/ /
* | MAINT: replace two step errstate change with a direct changeJulian Taylor2014-06-231-10/+5
| |
* | ENH: use copy to move the masked values into the resultJulian Taylor2014-06-231-7/+3
|/ | | | saves a relatively expensive bool -> x cast
* Merge pull request #4454 from jurnix/namedargsJulian Taylor2014-06-081-0/+10
|\ | | | | ENH: apply_along_axis accepts named arguments
| * ENH: apply_along_axis accepts named argumentsAlbert2014-03-271-0/+10
| |
* | ENH: rewrite ma.median to improve poor performance for multiple dimensionsJulian Taylor2014-06-022-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ENH: use sparse meshgrid instead of indices().tolist()Julian Taylor2014-06-021-5/+6
| | | | | | | | | | | | | | | | tolist() converts numpy integers to python integers which are converted back to numpy integers by the indexing. meshgrid(indexing='ij') returns the indices wanted here as the right type. triples performance of sorting a size=(200, 200, 50) array along axis 2 and reduces memory usage by almost 40%.
* | BUG, TST: Fix tests of ma.count return type.Charles Harris2014-05-102-26/+23
| | | | | | | | | | | | | | | | The masked array count method was fixed to use np.intp when doing sums. The return type is always np.intp except for count(arr, axis=None) when arr has no mask, in which case the return type is that of ndarray.size. The test errors were noted in #4698.
* | BUG: Fix test error in scipy introduced by commit d8fd283.Charles Harris2014-05-052-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "ENH: ma.asarray() and ma.asanyarray() will pass through input of the correct type." This reverts commit d8fd28389adb491e24b7cdc25cd1b20f539310c3. That commit caused test errors in scipy, which was apparently expecting a copy rather than a passed through array. The idea may be good, but at a minimum it should probably be preceded by a deprecation period. Closes #4675.
* | Revert line from #4585 to get mask, data shapes to match in .flatMarten van Kerkwijk2014-04-112-0/+10
| |
* | Ensure single record items also work correctly with MaskedIterator; testsMarten van Kerkwijk2014-04-102-7/+37
| |
* | BUG: Ensure MaskedArray.flat can access single itemsMarten van Kerkwijk2014-04-042-2/+12
| |
* | ENH: Ensure that repr and str work for MaskedArray non-ndarray basesMarten van Kerkwijk2014-04-043-11/+63
| | | | | | | | | | | | | | | | For repr, use the name of the base class in output as "masked_<name>" (with name=array for ndarray to match the previous implementation). For str, insert masked_print_option in an ndarray view of the object array that is created for string output, to avoid calling __setitem__ in the base class. Add tests to ensure this works.
* | Merge pull request #4463 from abalkin/issue-4461Charles Harris2014-04-032-9/+37
|\ \ | | | | | | BUG: Masked arrays and apply_over_axes
| * | BUG: Masked arrays and apply_over_axesLev Abalkin2014-04-012-9/+37
| |/ | | | | | | | | | | | | Masked arrays version of apply_over_axes did not apply function correctly to arrays with non-trivial masks. Fixes #4461.
* | BUG: Fix for issue #3213Tim Burgess2014-03-282-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | Two changes to numpy.ma.core._check_fill_value: 1. When the fill value is a string and the array type is not one of 'OSUV', raise TypeError instead of using the default fill value. 2. When the fill value overflows the type, raise TypeError instead of OverflowError. Closes #3213.
* | Merge pull request #4045 from abalkin/gh-4043Charles Harris2014-03-263-3/+20
|\ \ | | | | | | ENH: ma.asarray() and ma.asanyarray() will pass through input of the cor...
| * | BUG: Fixed mask_rowcols().Lev Abalkin2013-11-141-2/+2
| | | | | | | | | | | | | | | | | | | | | Previous implementation relied on ma.asarray() to always create a new object. See gh-4043.
| * | ENH: ma.asarray() and ma.asanyarray() will pass through input of the correct ↵Lev Abalkin2013-11-122-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type. If x is of type MaskedArray for ma.asarray(x) or any subtype of MaskedArray for ma.asanyarray(x), these functions will simply return x. This makes them consistent with their numpy counterparts. Closes gh-4043.
* | | ENH: Implemented ma.appendLev Abalkin2014-03-112-1/+80
| |/ |/| | | | | Fixes #2219.
* | BUG: Masked array filled method ignores fill valueLev Abalkin2014-03-042-1/+5
| | | | | | | | | | | | | | | | When string fill value is passed to the filled method of a masked array with object ('O') dtype, it is ignored and masked elements are filled with '?' instead. Fixes #4436
* | DOC apply correct documentation to np.ma.argminjnothman2014-03-031-1/+1
| | | | | | A typo assigned it the documentation for argmax.
* | Merge pull request #4105 from seberg/deprecate-boolean-mathCharles Harris2014-02-153-2/+16
|\ \ | | | | | | DEP: Deprecate boolean math operations
| * | BUG: Force allclose logic to use inexact typeSebastian Berg2014-02-162-12/+17
| | | | | | | | | | | | | | | | | | Casting y to an inexact type fixes problems such as abs(MIN_INT) < 0, and generally makes sense since the allclose logic is inherently for float types.
| * | DEP: Deprecate boolean `-` operationsSebastian Berg2014-02-122-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | ENH: add tobytes and stop using tostring in documentationJulian Taylor2014-02-112-8/+18
|/ / | | | | | | | | | | | | tostring returns bytes which are not equal to string, so provide a tobytes function alias. tostring does not emit a deprecation warning yet so rdepends do not need to check two names to support older versions of numpy without warnings.
* | DOC: Fix description of ma.average parameter.astaric2014-01-291-2/+2
| | | | | | | | Replace mention of variance in numpy.ma.average doc string with average.
* | BUG: Removed the inconsistencies of the function ma.countJanani2014-01-272-7/+6
| | | | | | | | | | | | | | | | The inconsistency of ma.count when appled on masked_array with mask as 'nomask' has been removed. the return type of the function has also been standardized according to the docs.Corresponding changes in testing to check the functioning of ma.count Closes gh-3368 and gh-4228
* | BUG: ma.compressed() function returns masked arrayLev Abalkin2013-11-132-4/+32
|/ | | | | | | | When a masked array with nomask was passed to ma.compressed() function, the result was the original masked array instead of an ndarray. Closes gh-4026.
* One revert (comparisons with None; not PEP8, but good to check); extra commentsMarten van Kerkwijk2013-10-122-10/+13
|
* Small further cleanups of ma.tests, plus correction for python3Marten van Kerkwijk2013-10-122-7/+8
|
* Convert docstrings to comments for nose; PEP8 cleanup (some tests activated)Marten van Kerkwijk2013-10-126-748/+667
|
* Small corrections to testsMarten van Kerkwijk2013-10-121-8/+9
|
* Add test cases to ensure NotImplemented is passed onMarten van Kerkwijk2013-10-121-0/+20
|
* Ensure NotImplemented is passed on in MaskedArray ufunc'sMarten van Kerkwijk2013-10-121-0/+9
|
* STY: Giant comma spacing fixup.Charles Harris2013-08-189-304/+304
| | | | | | | 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.
* STY: Giant whitespace cleanup.Charles Harris2013-08-182-6/+1
| | | | Now is as good a time as any with open PR's at a low.
* MAINT: Make setting mask values with scalars faster.Richard Hattersley2013-08-171-0/+10
| | | | | | | The current implementation assigns the mask value to a.flat, where a is the mask being updated. In the scalar case, that is slower than assigning to a[...], so when a is an instance of int, float, np.bool_, or np.number use that instead.
* MAINT: Remove uses of the WarningManager class.Charles Harris2013-07-122-22/+4
| | | | | | | | | | | | WarningManager was a workaround for the lack of the with statement in Python versions < 2.6. As those versions are no longer supported it can be removed. Deprecation notes are added to WarningManager and WarningMessage, but to avoid a cascade of messages in third party apps, no warnings are raised at this time, that can be done later. Closes #3519.
* MAINT: Use np.errstate context manager.Charles Harris2013-07-115-131/+92
| | | | | | | | | | | | | Now that Python < 2.6 is no longer supported we can use the errstate context manager in places where constructs like ``` old = seterr(invalid='ignore') try: blah finally: seterr(**old) ``` were used.