summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: more mist fixes of syntax.Matthias Bussonnier2021-01-281-1/+1
| | | | | Space before colon, or missing colon in see-also, typo in parameter names, casing in See Also.
* DOC: Avoid using "set of" when talking about an ordered list.Antony Lee2020-12-291-1/+1
| | | | | | | | | | | | ... or when the input isn't/cannot be a set. I left a few usages, e.g. in random sampling, where "set" is reasonable as informal description of an array as the order doesn't matter; however, for e.g. np.gradient the order of the returned list is clearly important, so "set" is wrong. Also some other minor doc edits noticed during the grepping: using `shape` instead of `form` in `cov` is consistent with most other places; the wording in `Polynomial.trim` now matches other methods on the same class.
* DOC: Fixing references in ma docstrings (#16300)Takanori H2020-10-071-4/+4
| | | Fix broken links in see also section of some ma functions.
* DOC: Fix syntax errors in docstrings for versionchanged, versionadded (#17338)Bradley Dice2020-09-171-1/+1
| | | * DOC: Fix typos in versionchanged.
* DOC: Fix malformed docstrings in ma. (#16296)Takanori H2020-06-111-8/+3
| | | | | | * DOC: fixing malformed documents Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* DOC: Add missing bracket (gh-16051)Chunlin2020-04-251-1/+1
| | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* DEP: Deprecate the axis argument to masked_rows and masked_colsEric Wieser2019-12-021-2/+14
| | | | | This argument isn't used, and is confusing. (Small test added by seberg)
* DOC: convert `None` to bare None or ``None``mattip2019-10-151-1/+1
|
* DOC: lib: Add more explanation of the weighted average calculation.Warren Weckesser2019-08-261-2/+5
| | | | | Also removed the incorrect comment from the docstring of `numpy.ma.average` about the imaginary part of `weights` being ignored.
* DOC: fix some more See Also issuesRalf Gommers2019-04-141-6/+6
| | | | These ones just generated warnings, not build failures
* DEV: cleanup imports and some assignments (from LGTM)mattip2019-03-171-1/+0
|
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-122/+137
| | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
* MAINT: rewrite np.ma.(median|sort) to use take_along_axisEric Wieser2018-05-251-24/+12
|
* MAINT: move all masked array matrix tests to matrixlib.Marten van Kerkwijk2018-04-271-3/+8
| | | | | | Further progress in isolating matrix in preparation of its deprecation. There is one place left with an explicit reference to matrix (in MaskedArray.count), which is to be solved later.
* BUG: Always return a list from np.ma.flatnotmasked_contiguousEric Wieser2018-03-251-13/+37
| | | | | | | | | | | | | 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.
* MAINT: Stop using non-tuple indices internallyEric Wieser2018-02-161-1/+2
| | | | | | By not using this type of indexing, it becomes easier for subclasses to override indexing in a way that works correctly with numpy functions. These locations were found by deprecating the behavior in question, which is deliberately not part of this commit
* BUG: concatenation using axis=None in union1dAnas Khan2018-01-091-1/+1
|
* BUG: arrays not being flattened in `union1d`Anas Khan2018-01-081-1/+1
|
* ENH: added masked version of 'numpy.stack' with tests.lzkelley2017-12-171-1/+2
| | | | | Uses '_fromnxfunction_seq' just like 'vstack', 'hstack', etc. Added release note to 1.15.0.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-2/+2
| | | | | | | 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
* MAINT: Use new-style classes on 2.7Eric Wieser2017-07-241-1/+1
| | | | Deliberately avoids tests, to prevent introducing a failure on old-style classes later.
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | Bare except is very rarely the right thing
* ENH: Spelling fixesVille Skyttä2017-05-091-4/+4
|
* BUG: np.ma.mr_['r',...] does not return masked arraysEric Wieser2017-05-051-0/+4
|
* MAINT: Remove code duplicated from np.r_ in np.ma.mr_Eric Wieser2017-05-051-50/+5
| | | | | Also adds a test for the disabled-by-design behaviour - this would return raw matrices, not masked arrays
* ENH: Add isin, genereralizing in1d to ND arrays (#8423)B R S Recht2017-05-051-1/+28
| | | | | | 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.
* MAINT: Rename _validate_axis, and document itEric Wieser2017-03-281-2/+2
|
* MAINT: Reuse _validate_axis in maEric Wieser2017-03-281-11/+5
|
* BUG: fix ma.median for empty ndarraysJulian Taylor2017-02-271-0/+7
| | | | | return nan as it did in 1.11 and same as normal median. closes gh-8703
* MAINT: Use normalize_axis_index in all python axis checkingEric Wieser2017-02-201-7/+4
| | | | | | | As a result, some exceptions change from ValueError to IndexError This also changes the exception types raised in places where normalize_axis_index is not quite appropriate
* MAINT: remove ma out= workaroundJulian Taylor2017-02-061-4/+0
| | | | unnecessary since gh-8416
* BUG: fix wrong masked median for some special casesJulian Taylor2017-01-171-6/+13
| | | | | | | 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
* TST: extend ma.median testing and fix inconsistent out returnJulian Taylor2016-12-251-0/+4
|
* BUG: fixed failure of np.ma.median for 1-D even arrays.Marten van Kerkwijk2016-12-231-2/+3
| | | | | | 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.
* BUG: handle unmasked NaN in ma.median like normal medianJulian Taylor2016-12-121-10/+42
| | | | | | | | | | | 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.
* BUG: fix np.ma.median with only one non-masked valueLoïc Estève2016-09-071-2/+1
| | | | and an axis argument. Add test.
* BUG: Fix numpy.ma.median for various things.Charles Harris2016-09-051-8/+11
| | | | | | | | | | | This fixes four bugs: - Use of booleans for indexing in ma.extras._median - Error when mask is nomask and ndim != 1 in ma.extras._median - Did not work for 0-d arrays. - No out argument for {0,1}-d arrays. Closes #8015.
* ENH: Add stacklevel to all (or almost all) our function callsSebastian Berg2016-09-021-1/+1
|
* BUG: Fixed masked array behavior for scalar inputs to np.ma.atleast_*dJoseph Fox-Rabinovitz2016-08-241-43/+99
|
* BUG: modified ndim condition to use masked_arrayskwbc2016-08-071-1/+1
|
* BUG: fix for issue#7835 (ma.median of 1d)Shota Kawabuchi2016-08-071-4/+8
|
* STY: ma.extras.median: avoid indexing with listAmit Aronovitch2016-05-221-2/+2
| | | | Recommended type for nd-indexing is a tuple. See #4434
* BUG: ma.median of 1d array should return a scalarAmit Aronovitch2016-05-221-1/+5
| | | | | | Fixes #5969. Performance fix #4760 had caused wrong shaped results in the 1D case. This fix restores the original 1D behavior.
* ENH: update MA average, medianAllan Haldane2016-04-041-88/+61
|
* ENH: Make no unshare mask future warnings less noisySebastian Berg2016-03-011-2/+4
| | | | | Incorporates Nathaniels suggestions for a longer explanation in the release notes.
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-7/+7
| | | | Closes gh-6863.
* BUG, MAINT: Refactor ma.dot function and the corresponding method.Charles Harris2015-11-101-144/+2
| | | | | | | | | | | | | 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.
* STY: Minor style fixups.Charles Harris2015-11-071-1/+2
| | | | | Fix some long lines and indentation in numpy/ma/core.py and numpy/ma/extras.py