This repository has been archived by the owner on May 4, 2019. It is now read-only.
Open
Description
mapreduce
works when no missing values are present in a NullableArray
, but map
doesn't. None of them work when a missing value is present. Not sure what's the intended behavior.
julia> a = NullableArray([1,2,3])
3-element NullableArray{Int64,1}:
1
2
3
julia> map(exp, a)
ERROR: MethodError: `exp` has no method matching exp(::Nullable{Int64})
[inlined code] from essentials.jl:58
in ___F_#21__ at /home/milan/.julia/NullableArrays.jl/src/map.jl:124
in __map#3__ at /home/milan/.julia/NullableArrays.jl/src/map.jl:172
julia> mapreduce(exp, +, a)
Nullable(30.19287485057736)
julia> b = NullableArray([1,2,3], [false, false, true])
3-element NullableArray{Int64,1}:
1
2
#NULL
julia> mapreduce(exp, +, b)
ERROR: MethodError: `exp` has no method matching exp(::Nullable{Int64})
[inlined code] from essentials.jl:58
in _mapreduce at reduce.jl:143
[inlined code] from /home/milan/.julia/NullableArrays.jl/src/indexing.jl:4
in _mapreduce at /home/milan/.julia/NullableArrays.jl/src/reduce.jl:78
in __mapreduce#7__ at /home/milan/.julia/NullableArrays.jl/src/reduce.jl:99
Metadata
Assignees
Labels
No labels