Assume I have the following DataFrame and want to remove rows containing NaN:
df = DataFrame(a=[NaN, 1.1, NaN, missing, missing], b=[1.1, 2, 3, missing, NaN], c='a':'e');
For just one column I could do something like:
filter(x->(ismissing(x.a) || !isnan(x.a)), df)
To extend this to all columns I tried to use the subset function in combination with the usual DataFrame transformation syntax, but couldn’t get it to work:
subset(df, :a => ByRow(x->(ismissing(x) || !isnan(x))))
(works)
subset(df, names(df, Union{Float64, Missing}) .=> ByRow(x->(ismissing(x) || !isnan(x))))
(doesn’t work)