On Thu, Dec 26, 2019 at 05:51:09PM -, Marco Sulla via Python-ideas wrote:
> Stephen J. Turnbull wrote:
> > > from statistics import mean
> > > sum([1e16,1,1])/3 == 1e16/3# surprise!
> > > True
> > > mean([1e16,1,1]) == 1e16/3
> > > False
> > > Regards,
>
> Python 3.9.0a0
(even it costs
>nothing) so I won't consume a line.
>
>
> Cordialement/Regards
> Kemal DIRI
>
>
>
>
> --
> *De :* Sebastian Kreft
> *Envoyé :* jeudi 26 décembre 2019 15:07
> *À :* Kemal Diri
> *Cc :* python-ideas@python.org ;
&
Stephen J. Turnbull wrote:
> > from statistics import mean
> > sum([1e16,1,1])/3 == 1e16/3# surprise!
> > True
> > mean([1e16,1,1]) == 1e16/3
> > False
> > Regards,
Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01)
[GCC 9.2.1 20190909] on linux
Type "help",
So why only mean and not median, that's better for statistics? :D
Seriously, if you want it builtin, add it to PYTHONSTARTUP:
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP
from statistics import mean
___
Python-ideas mailing
The Python standard library module 'statistics' has a "mean" function.
On Thu, Dec 26, 2019, 08:54 Kemal Diri wrote:
> Hello,
>
> I think it would be nice to introduce an avg method for lists as a
> built-in function in python3.
> To get average of the list, I need to use some libs (eg numpy).
; kemald...@gmail.com
Objet : Re: [Python-ideas] AVG Function as Built-in
Just use `from statistics import mean as avg` (see
https://docs.python.org/3/library/statistics.html#statistics.mean).
Please provide some justification on why do you think it's desirable to make
`avg` a builtin, considering
Just use `from statistics import mean as avg` (see
https://docs.python.org/3/library/statistics.html#statistics.mean).
Please provide some justification on why do you think it's desirable to
make `avg` a builtin, considering, that doing so is a backwards
incompatible change due to the more than