November 2018
Intermediate to advanced
460 pages
14h 1m
English
In this recipe, we present two approaches to calculating the final grade:
julia> function get_grade(final, midterm, takehome) (ismissing(final) || final < 50) && return "fail" if final < 75 && coalesce(midterm, 0) < 50 && coalesce(takehome, 0) < 50 "fail" else "pass" end endget_grade (generic function with 1 method)
julia> df.grade = get_grade.(df.Final, df.Midterm, df.TakeHome);
julia> df.grade2 = map(eachrow(df)) do r coalesce(r.Final, ...
Read now
Unlock full access