From a0654bdda12bd640c3e292738f02a7c4f72ddf5b Mon Sep 17 00:00:00 2001 From: Ron Wolf Date: Mon, 22 Jun 2020 00:20:11 -0400 Subject: [PATCH 1/2] Use dot-notation: quantile.(d, X) See the pull request for code that calls iqr(), producing a warning from within StatsBase --- src/scalarstats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scalarstats.jl b/src/scalarstats.jl index 41486c41b..40bd1ac00 100644 --- a/src/scalarstats.jl +++ b/src/scalarstats.jl @@ -337,7 +337,7 @@ end Compute the interquartile range (IQR) of collection `x`, i.e. the 75th percentile minus the 25th percentile. """ -iqr(x) = (q = quantile(x, [.25, .75]); q[2] - q[1]) +iqr(x) = (q = quantile.(x, [.25, .75]); q[2] - q[1]) # Generalized variance """ From de067450d6b737a2d391ac729ffe470acfb55822 Mon Sep 17 00:00:00 2001 From: Ron Wolf Date: Fri, 24 Jul 2020 16:24:16 -0400 Subject: [PATCH 2/2] Use Ref to avoid broadcasting collection Broadcast only over probabilities (second argument), not collection (first argument) Co-authored-by: Milan Bouchet-Valat --- src/scalarstats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scalarstats.jl b/src/scalarstats.jl index 40bd1ac00..4dd5cf401 100644 --- a/src/scalarstats.jl +++ b/src/scalarstats.jl @@ -337,7 +337,7 @@ end Compute the interquartile range (IQR) of collection `x`, i.e. the 75th percentile minus the 25th percentile. """ -iqr(x) = (q = quantile.(x, [.25, .75]); q[2] - q[1]) +iqr(x) = (q = quantile.(Ref(x), [.25, .75]); q[2] - q[1]) # Generalized variance """