Consider an astropy
Table() object.
from astropy.io import ascii
weather_data = """
day,precip,type
,1.5,rain
Tues, 9.,
Wed,1.1,snow
ed,,aaa
Wd,1.1,snow
"""
dat = ascii.read(weather_data)
print(dat)
day precip type
---- ------ ----
-- 1.5 rain
Tues 9.0 --
Wed 1.1 snow
ed -- aaa
Wd 1.1 snow
I need to drop all rows that contain at least one masked element. The final table should then look like:
day precip type
---- ------ ----
Wed 1.1 snow
Wd 1.1 snow
This seems like a simple task, but I could not find a way t do it in the docs.
Add
I know that I could use .to_pandas()
to convert the table to a pandas
object and then use something like .dropna()
, but this forces me to have pandas
installed which I don't want.