From 2b21aae5299cf19c8a5d4ed0fdc6177ab4a8fb20 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 18:36:48 +0100 Subject: [PATCH] News and compat annotation for #29033 (mean and var for empty iterators). --- NEWS.md | 1 + stdlib/Statistics/src/Statistics.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 923cf7877e861..2d9b0a9eb11fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -72,6 +72,7 @@ Standard library changes * `merge(::NamedTuple, ::NamedTuple...)` can now be used with more than 2 `NamedTuple`s ([#29259]). * `Future.copy!` has been moved to `Base` ([#29178]). * New `ncodeunits(c::Char)` method as a fast equivalent to `ncodeunits(string(c))` ([#29153]). + * `mean` and `var` now handles the empty case ([#29033]). Compiler/Runtime improvements ----------------------------- diff --git a/stdlib/Statistics/src/Statistics.jl b/stdlib/Statistics/src/Statistics.jl index efb518f82625f..d85169e0656f4 100644 --- a/stdlib/Statistics/src/Statistics.jl +++ b/stdlib/Statistics/src/Statistics.jl @@ -109,6 +109,9 @@ end Compute the mean of an array over the given dimensions. +!!! compat "Julia 1.1" + `mean` for empty arrays requires at least Julia 1.1. + # Examples ```jldoctest julia> A = [1 2; 3 4]