8000 Merge pull request #6920 from gfyoung/filled_documentation · numpy/numpy@2fb2b66 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fb2b66

Browse files
committed
Merge pull request #6920 from gfyoung/filled_documentation
DOC: Fix documentation on MaskedArray.filled
2 parents b8fef84 + 4d129a4 commit 2fb2b66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numpy/ma/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,8 @@ def set_fill_value(self, value=None):
35263526
def filled(self, fill_value=None):
35273527
"""
35283528
Return a copy of self, with masked values filled with a given value.
3529+
**However**, if there are no masked values to fill, self will be
3530+
returned instead as an ndarray.
35293531
35303532
Parameters
35313533
----------
@@ -3537,7 +3539,9 @@ def filled(self, fill_value=None):
35373539
-------
35383540
filled_array : ndarray
35393541
A copy of ``self`` with invalid entries replaced by *fill_value*
3540-
(be it the function argument or the attribute of ``self``.
3542+
(be it the function argument or the attribute of ``self``), or
3543+
``self`` itself as an ndarray if there are no invalid entries to
3544+
be replaced.
35413545
35423546
Notes
35433547
-----

0 commit comments

Comments
 (0)
0