-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nanpctile() gives an error: UndefVarError: T not defined for multidimension array #15
Comments
Hmm, good question. Which versions of Julia and NaNStatistics are you on? I can't seem to reproduce locally:
|
Here is the info: Hm.. yeah, I see it works for you. I am using VSC julia extension. |
Huh, odd. I don't have easy access to a Windows machine but I can try enabling CI on Windows and seeing if that catches anything. |
One more, there are some cells that NaNs go across all arrays (20x NaN). But I would expect to get NaN for those cells as I get for median calculation right?
That would be great! Thank you for looking into it! |
Ah, I think I found the problem |
Ok, that should do it. Try updating to v0.6.9 once that gets registered and see if that works on your end! |
Thank you! Will surely inform you if that works:) |
Fix bug in handling of percentiles of all-NaN collections
Works! Perfect! Thank you very much! |
Any time! |
Hello!
I wanted to apply some statistic functions over a big array: 1675×1265×20 Array{Float32, 3} that has NaNs.
While it works well to get e.g. median across third dimension and reduce to matrix:
median_ar = nanmedian(rast_fin, dim=3)
it gives: 1675×1265 Matrix{Float32}
however, when try:
iqr_25_ar =nanpctile(rast_fin, 25, dim=3)
it gives error: UndefVarError: T not defined
What am I missing?
Thanks!
Stacktrace:
[1] _nanquantile!(A::SubArray{Float32, 1, Array{Float32, 3}, Tuple{Int64, Int64, Base.Slice{Base.OneTo{Int64}}}, true}, q::Float64, #unused#::Colon)
@ NaNStatistics C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:152
[2] macro expansion
@ C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:212 [inlined]
[3] _nanquantile!(B::Array{Float32, 3}, A::Array{Float32, 3}, q::Float64, dims::Tuple{Static.StaticInt{3}})
@ NaNStatistics C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:268
[4] macro expansion
@ C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:268 [inlined]
[5] _nanquantile!(B::Array{Float32, 3}, A::Array{Float32, 3}, q::Float64, dims::Tuple{Int64})
@ NaNStatistics C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:268
[6] _nanquantile!
@ C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:141 [inlined]
[7] _nanquantile!
@ C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:131 [inlined]
[8] __nanpctile!(A::Array{Float32, 3}, p::Int64, #unused#::Colon, region::Int64)
@ NaNStatistics C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:74
[9] __nanpctile(A::Array{Float32, 3}, p::Int64, dims::Function, dim::Int64)
@ NaNStatistics C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:17
[10] #nanpctile#49
@ C:\Users\monikat.julia\packages\NaNStatistics\ryatP\src\Sorting\nanpctile.jl:14 [inlined]
The text was updated successfully, but these errors were encountered: