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


Groups > comp.lang.python > #97119

Re: Problem to calculate the mean in version 3.4

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Problem to calculate the mean in version 3.4
Date Fri, 25 Sep 2015 00:12:05 -0700
Organization A noiseless patient Spider
Lines 15
Message-ID <87eghnas6y.fsf@jester.gateway.sonic.net> (permalink)
References <mailman.163.1443164128.28679.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="b061f73cef760cb35224bce5e09434e2"; logging-data="26504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BTXzH6aGdagrOZfb60SHG"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:gMM7oya7LE56bFq7LFZsM5Z2ycs= sha1:zIPijtfXjFMnhy4QjSCfrnflZ0A=
Xref csiph.com comp.lang.python:97119

Show key headers only | View raw


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])

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web