BUG: MaskedArray.fill_value
not consistently preserved in structured voids with array-valued fields
#28450
Labels
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
If a masked array of a structured void type with an array-valued field is built, the
.fill_value
s differ between the following two cases (see the example):np.ma.core.mvoid
type), then accessing the array-valued field, andWhile both chains of item access result in a new masked array of the shape of the array-valued field, they have different
.fill_value
s; the first form results in a.fill_value
which:.fill_value
of the parent array, substituting it with the default value for the data type as given by.get_fill_value()
.Beside
numpy 2.2
, the bug is also consistently reproduced innumpy 1.24
on my machine (MacOS 14.6.1 on M3 chip). Presumably,numpy
versions in between and before are also affected. Since this also has to do with.fill_value
inconsistencies on differing orders of operations, #22141 may be a related issue.Reproduce the code example:
Error message:
Python and NumPy Versions:
Runtime Environment:
No response
Context for the issue:
It is understood that this is an edge case, and the
.fill_value
is mostly not of concern to end-users. Still, it may be of use to document it here, and of interest in revealing other possible inconsistencies.The text was updated successfully, but these errors were encountered: