You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very handy if there was support for NaNStatistics. I couldn't find an easy way to rewrap the output array so I did this ugly workaround:
NaNStatistics.nansum(A::KeyedArray; dim=:, dims=:) = rewrap_keyedarray(nansum(A.data.data; dim, dims), A, dims isa Colon ? dim : dims)
function rewrap_keyedarray(new, original, dims)
axs = NamedTuple{propertynames(original)}(original.keys) |> pairs
if ndims(new) < ndims(original)
axs = collect(axs)[1:end .!= dims]
else
axs = Dict(axs)
for dim in dims
axs[propertynames(original)[dim]] = axes(new, dim)
end
axs = [k => axs[k] for k in propertynames(original)]
end
KeyedArray(new; axs...)
end
Thanks
The text was updated successfully, but these errors were encountered:
This code is not so far from everything else in this package, and now that it has extensions (thanks to #151) it's fine to have one more for this package. Probably mostly copied from here:
It would be very handy if there was support for NaNStatistics. I couldn't find an easy way to rewrap the output array so I did this ugly workaround:
Thanks
The text was updated successfully, but these errors were encountered: