Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97119 > unrolled thread

Re: Problem to calculate the mean in version 3.4

Started byPaul Rubin <no.email@nospam.invalid>
First post2015-09-25 00:12 -0700
Last post2015-09-25 00:12 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Problem to calculate the mean in version 3.4 Paul Rubin <no.email@nospam.invalid> - 2015-09-25 00:12 -0700

#97119 — Re: Problem to calculate the mean in version 3.4

FromPaul Rubin <no.email@nospam.invalid>
Date2015-09-25 00:12 -0700
SubjectRe: Problem to calculate the mean in version 3.4
Message-ID<87eghnas6y.fsf@jester.gateway.sonic.net>
Michel Guirguis <guirguismichel@yahoo.co.uk> writes:
>>>> mean([1, 2, 3, 4, 4])
> Traceback (most recent call last):...
> NameError: name 'mean' is not defined

Before you can use that function, you have to import the statistics
module, e.g.:

    >>> import statistics
    >>> statistics.mean([1,2,3,4,4])   

or

    >>> from statistics import mean
    >>> mean([1,2,3,4,4])

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web