Search code examples
juliajuliadb

Why Julia/JuliaDB behaves differently while filtering?


Executing

filter(i -> !ismissing(i.dep_delay > 60), select(flights, (:carrier, :dep_delay)))

should return the carriers with delay more than 60mins(my understanding!). But it returns carriers with all positive and negative dep_delays.

Why it behaves so?


Solution

  • I understand you rather wanted to write:

    filter(i -> coalesce(i.dep_delay > 60, false), select(flights, (:carrier, :dep_delay)))
    

    If you write !ismissing(i.dep_delay > 60) you will get true if i.dep_delay is not missing.