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
When normalizing a Histogram, the normalize function produces floating point values for the weights. The in-place version (i.e. normalize!) can only be called for Histograms that have floating point weights. When calling normalize! on a Histogram with non-floating point weights the resulting "no method matching..." MethodError is technically correct, but it would be more helpful to display a more informative message. This could be done my defining:
function normalize!(h::Histogram{T,N}, aux_weights::Array{T,N}...; mode::Symbol=:pdf) where {T,N}
error("Cannot normalize a Histogram with $T weights in-place")
end
The text was updated successfully, but these errors were encountered:
When normalizing a
Histogram
, thenormalize
function produces floating point values for the weights. The in-place version (i.e.normalize!
) can only be called forHistogram
s that have floating point weights. When callingnormalize!
on aHistogram
with non-floating point weights the resulting "no method matching..."MethodError
is technically correct, but it would be more helpful to display a more informative message. This could be done my defining:The text was updated successfully, but these errors were encountered: