Dealing with NaN's

Here’s one way using filter:

# Using a lambda that receives a named tuple for each row
filter(AsTable(:) => row->!any(isnan(x) for x in row), df)

You could also write filter(row->!any(isnan(x) for x in row), df) but that’s slower.

Or you could write filter((:) => (values...)->!any(isnan.(values)), df) to use a lambda that receives the row as one parameter per column, but that’s even slower apparently.

2 Likes