summaryrefslogtreecommitdiff
path: root/numpy/ma
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #22046 from cmarmo/masked-invalidSebastian Berg2022-10-052-13/+13
|\ | | | | BUG: Make `mask_invalid` consistent with `mask_where` if `copy` is set to `False`
| * Remove try statement. Add test.Chiara Marmo2022-09-072-4/+5
| |
| * Fix lint.Chiara Marmo2022-07-251-1/+2
| |
| * Make mask_invalid consistent with mask_where when copy is set to False. Add ↵Chiara Marmo2022-07-252-13/+11
| | | | | | | | test for type erroring.
* | Added ma.min examplesFelix Hirwa Nshuti2022-10-011-1/+1
| |
* | Added ma.min examplesFelix Hirwa Nshuti2022-10-011-0/+30
| |
* | DOC: Adding examples to `ma.max` function (#22331)Felix Hirwa Nshuti2022-09-271-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add examples to ma.max function * indent fix Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * Indententation fixes * Indent fixes Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * Indent fixes Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * Added example that gives masked array * fix output indent * Update numpy/ma/core.py * Update numpy/ma/core.py Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* | BUG: Import ``numpy.ma`` at beginning of examples.Charles Harris2022-09-171-0/+1
| |
* | DOC: add example for ma.unique functionswagatip2022-09-161-0/+25
| |
* | Remove long deprecated functionality from np.maBrigitta Sipőcz2022-09-082-87/+2
| |
* | Merge pull request #21995 from eirrgang/mei-1468Matti Picus2022-09-071-1/+1
|\ \ | |/ |/| BUG: Distinguish exact vs. equivalent dtype for C type aliases.
| * Don't regenerate the descriptor unnecessarily.M. Eric Irrgang2022-07-161-1/+1
| | | | | | | | | | Fix a false mismatch. Separate dtype objects, even if equivalent, cause distinct array views to be created.
* | Revert "TST: add a test for ma.minimum.reduce with axis keyword"mattip2022-07-201-12/+0
| | | | | | | | This reverts commit e2efced9bdfc773f5aca2487f12ab1cb2bd11833.
* | Revert "BUG: Fix masked median multiple masked arrays (#21999)"mattip2022-07-202-23/+1
| | | | | | | | This reverts commit 6b8d55e66e532d66e1701ad039b4cda306839b3f.
* | Revert "ENH: Adding __array_ufunc__ capability to MaskedArrays."mattip2022-07-203-194/+47
| | | | | | | | This reverts commit 8cd6f4ca00b6e0da3833fc267d50067b2ddbc069.
* | Revert "nomask in nomask out" from 21977mattip2022-07-201-2/+2
| | | | | | | | This reverts commit db1a98bf194771a677dbc0c2e06bc47f4a9947a8.
* | Revert "BUG: fix ma.minimum.reduce with axis keyword"mattip2022-07-201-2/+0
| | | | | | | | This reverts commit b8c6d09208ecb7f0d83a8b06ab9e15e720f03730.
* | BUG: Fix masked median multiple masked arrays (#21999)Brigitta Sipőcz2022-07-172-1/+23
| | | | | | | | | | | | | | Fixed issue that occurs when trying to take the median of a list of masked arrays. Added a check to see if the input is a list then converts to a masked array. See issue #10757 for more information. Co-authored-by: jsclose <jsclose@umich.edu>
* | BUG: fix ma.minimum.reduce with axis keywordRuth Comer2022-07-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | Fixes the problem reported at https://github.com/numpy/numpy/pull/21977#issuecomment-1186082534 The reduce method here effectively calls itself with an unmasked MaskedArray (mask=nomask) and then expects either a MaskedArray or a scalar. This change ensures that an ordinary ndarray is converted to a MaskedArray, following the pattern already used in mean and var in this module.
* | TST: add a test for ma.minimum.reduce with axis keywordRuth Comer2022-07-161-0/+12
|/ | | | | Adapted from the problem reported at https://github.com/numpy/numpy/pull/21977#issuecomment-1186082534
* nomask in nomask outRuth Comer2022-07-131-2/+2
|
* TST: Adding a test that MaskedArrays respect ufunc deferral heirarchyGreg Lucas2022-07-131-0/+64
| | | | | This test makes sure that a MaskedArray defers properly to another class if it doesn't know how to handle it. See #15200.
* ENH: Adding __array_ufunc__ capability to MaskedArrays.Greg Lucas2022-07-133-47/+194
| | | | | | This enables any ufunc numpy operations that are called on a MaskedArray to use the masked version of that function automatically without needing to resort to np.ma.func() calls.
* Revert "ENH: Adding __array_ufunc__ capability to MaskedArrays"Matti Picus2022-07-094-253/+47
|
* TST: Adding a test that MaskedArrays respect ufunc deferral heirarchyGreg Lucas2022-06-291-0/+59
| | | | | This test makes sure that a MaskedArray defers properly to another class if it doesn't know how to handle it. See #15200.
* ENH: Adding __array_ufunc__ capability to MaskedArrays.Greg Lucas2022-06-293-47/+194
| | | | | | This enables any ufunc numpy operations that are called on a MaskedArray to use the masked version of that function automatically without needing to resort to np.ma.func() calls.
* BUG: Use `keepdims` during normalization in `np.average` and `np.ma.average` ↵Srimukh Sripada2022-06-262-1/+10
| | | | | | | | | (#21851) The keepdims flag needs to be applied during the calculation of the sum of the weights in np.average and np.ma.average. Not passing it causes weights to broadcast incorrectly. Fixes #21850
* API: Define `<`, `<=`, `>`, `>=` for masked arraysSebastian Berg2022-06-212-1/+65
| | | | | | | | | | This defines the comparison operators (other than `==` and `!=`) explicitly for masked arrays. The mask is ignored for the resuling `res._data` (unlike `==` and `!=` which take the mask into account. Closes gh-21770, although the way that masked arrays propagate the fill-value seems generally broken and error prone.
* ENH: Add overflow check to float setitemSebastian Berg2022-06-131-1/+5
|
* TST: Fixup tests that cause FPEs during castsSebastian Berg2022-06-131-1/+4
|
* Merge pull request #20914 from kinshukdua/fix_ma_meanMatti Picus2022-06-122-1/+16
|\ | | | | BUG: change `ma.mean` dtype to be consistent with `np.mean`
| * BUG: change `ma.mean` dtype to be consistent with `np.mean`Kinshuk Dua2022-01-272-1/+16
| |
* | Merge pull request #21620 from seberg/promotion-prepsMatti Picus2022-05-292-54/+42
|\ \ | | | | | | MAINT: Fortify masked in-place ops against promotion warnings
| * | TST,MAINT: Simplify warning testing in masked arraysSebastian Berg2022-05-271-36/+18
| | | | | | | | | | | | | | | There is no point in catching the warnigns when raising will do (because we want 0 warnings). That is more informative in any case.
| * | MAINT: Fortify masked in-place ops against promotion warningsSebastian Berg2022-05-271-18/+24
| | | | | | | | | | | | | | | | | | These warnings are probably optional in the future. They should not matter much (since the following is an in-place op), but the `np.where` could upcast currently!
* | | Fix some typos.Yulv-git2022-05-141-1/+1
|/ /
* | TST: Fix uninitialized value in masked ndenumerate testSebastian Berg2022-05-121-1/+1
| | | | | | | | | | | | The test used unintialized values, if NaN happened to be there the test would fail (and generally, uninitialized values being used in tests is bad, since it shows up in valgrind).
* | Merge pull request #20020 from joukewitteveen/ma-ndenumerateMatti Picus2022-05-114-7/+115
|\ \ | | | | | | ENH: add ndenumerate specialization for masked arrays
| * | ENH: Add compressed= argument to ma.ndenumerateJouke Witteveen2022-05-103-7/+38
| | |
| * | Update numpy/ma/extras.pyMatti Picus2022-04-221-1/+2
| | |
| * | ENH: add ndenumerate specialization for masked arraysJouke Witteveen2022-04-224-7/+83
| | |
* | | TYP: Add typing for the keepdims param. of 'average' and 'ma.average'warren2022-05-101-1/+1
| | | | | | | | | | | | This is a follow-up to gh-21485.
* | | ENH: Add 'keepdims' to 'average()' and 'ma.average()'.warren2022-05-092-5/+61
|/ /
* | Add space after argument nameOscar Gustafsson2022-04-031-6/+6
| |
* | DOC: fix data type of parameter shape (#21251)Pax2022-03-261-2/+2
| | | | | | | | | | | | | | `np.ma.masked_all` uses `np.empty` under the hood, so the parameter description for shape in `masked_all` should be updated to match that of `np.empty`. Relevant issue: #21203
* | DOC: fix input parameter type in docstring.Ross Barnowski2022-01-271-1/+1
| |
* | DOC: fix np.ma.flatnotmasked_contiguous docstringstephenworsley2022-01-271-1/+1
| | | | | | The first line of the docstring for `flatnotmasked_contiguous` was identical to that in `notmasked_contiguous` and refered to a given axis despite the fact that no axis is given as an argument.
* | DOC: Restore MaskedArray.hardmask documentation (#20810)Hans Meine2022-01-181-8/+51
| |
* | ENH: Let ndarray.__array_finalize__ be callable.Marten van Kerkwijk2022-01-081-3/+2
| | | | | | | | | | This helps subclasses, who can now do super() in their own implementation.
* | Merge pull request #20505 from scratchmex/ma_averageMatti Picus2021-12-242-1/+27
|\ \ | | | | | | BUG: fix `ma.average` not working well with `nan` weights