# Error under Julia 1.0.0/1 when executing mean(1:20) (In Julia 0.6.2 it worked)

**URL:** <https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996>\
**Category:** New to Julia\
**Created:** [October 7, 2018, 4:12pm UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996 "2018-10-07T16:12:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [October 7, 2018, 4:12pm UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996/1 "2018-10-07T16:12:41Z")

</div>

The command “mean” ist not working under Julia 1.0.1:

Here it worked fine:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/7/e74d8eefa73ccf8cb61740d157a3b3c858d2de18.png)

And here not:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/3/239d896e7d5cba6faceaa8fe6cf0ad37bf05e1a5.png)

Any Idea why this happend and how to fix it?

---

<div class="post-metadata">

**Author:** ![saschatimme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschatimme/32/10313_2.png) [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Post date:** [October 7, 2018, 4:18pm UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996/2 "2018-10-07T16:18:52Z")

</div>

`mean` got moved into the standard library [Statistics](https://docs.julialang.org/en/v1/stdlib/Statistics/).

```julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.1 (2018-09-29)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using Statistics

julia> mean(1:20)
10.5

```

---

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [October 7, 2018, 4:23pm UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996/3 "2018-10-07T16:23:09Z")

</div>

> [@saschatimme](#):
>
> using Statistics

Thank you. It worked!  
Ralf

---

<div class="post-metadata">

**Author:** ![RaulDurand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rauldurand/32/2044_2.png) [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Post date:** [October 7, 2018, 4:24pm UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996/4 "2018-10-07T16:24:13Z")

</div>

A general recommendation would be: Do not compare 1.0 results with 0.6 but with its immediate predecessor 0.7. Julia 0.7 prints required warnings and deprecations.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [October 9, 2018, 9:13am UTC](https://discourse.julialang.org/t/error-under-julia-1-0-0-1-when-executing-mean-1-20-in-julia-0-6-2-it-worked/15996/5 "2018-10-09T09:13:37Z")

</div>

Or use something like Dash to search the docs

 ![Monosnap%202018-10-09%2012-12-42](https://global.discourse-cdn.com/julialang/original/3X/2/d/2de85b46c5a540adfa63d62f29708772f6ba4f09.png)
