-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Closed
Copy link
Description
Description
The current documentation makes it seem like it should be possible to have a column with quantities that are masked. QTable for example allows for masked=True. There are many examples throughout the documentation (for example here) which show a masked column in a QTable.
Expected behavior
from astropy.table import QTable, MaskedColumn
import astropy.units as u
tbl = QTable(masked=True)
tbl.add_column(MaskedColumn([1, 2] * u.keV, mask=[True, False]))
print(tbl)
output
col0
keV
----
-
2.0Actual behavior
from astropy.table import QTable, MaskedColumn
import astropy.units as u
tbl = QTable(masked=True)
tbl.add_column(MaskedColumn([1, 2] * u.keV, mask=[True, False]))
print(tbl)
output
col0
keV
----
1.0
2.0Recommendation
Given that masked Quantities arrays are not a thing (see #1852), I would recommend that there be a note or warning adding to the documentation to make it crystal clear that it is currently not possible to make a MaskedColumn with quantities. I might even go so far as to issue a warning when a user tried to create a MaskedColumn with quantities.
System Details
import astropy; print("astropy", astropy.__version__)
'4.0.1.post1'