Le jeudi 13 octobre 2016 à 06:45 -0700, Florian Oswald a écrit :
> I mean, do I have to cycle through the array and basically clean it
> of #NULL before findign the maximium or is there another way?
Currently you have two solutions:
julia> using NullableArrays

julia> x = NullableArray([1, 2, 3, Nullable()])
4-element NullableArrays.NullableArray{Int64,1}:
 1    
 2    
 3    
 #NULL

julia> minimum(x, skipnull=true)
Nullable{Int64}(1)


Or:

julia> minimum(dropnull(x))
1


Regards

> > i'm trying to understand why we don't have something similar in
> > terms of comparison for Nullable as we have for DataArrays NAtype
> > (below). point me to the relevant github conversation, if any, is
> > fine. 
> > 
> > How would I implement methods to find the maximium of an
> > Array{Nullable{Float64}}? like so?
> > 
> > Base.isless(a::Any, x::Nullable{Float64}) = isnull(x) ? true :
> > Base.isless(a,get(x))
> > 
> > 
> > ~/.julia/v0.5/DataArrays/src/operators.jl:502
> > 
> > #
> > # Comparison operators
> > #
> > 
> > Base.isequal(::NAtype, ::NAtype) = true
> > Base.isequal(::NAtype, b) = false
> > Base.isequal(a, ::NAtype) = false
> > Base.isless(::NAtype, ::NAtype) = false
> > Base.isless(::NAtype, b) = false
> > Base.isless(a, ::NAtype) = true
> > 
> > 

Reply via email to