Wolfgang Maier added the comment:
Well, I was thinking about frequencies (ints) when suggesting
for x,m in data.items():
T = _coerce_types(T, type(x))
n, d = exact_ratio(x)
partials[d] = partials_get(d, 0) + n*m
in my previous message. To support weights (float
Wolfgang Maier added the comment:
there are currently two strict requirements for any numeric type to be usable
with statistics._sum:
I meant *three* of course (remembered one only during writing).
--
___
Python tracker rep...@bugs.python.org
Wolfgang Maier added the comment:
Just to make sure that this discussion is not getting on the wrong track,
there are currently two strict requirements for any numeric type to be usable
with statistics._sum:
(1) the type has to provide either
- numerator/denominator properties
Wolfgang Maier added the comment:
Once the input numbers are converted to float statistics._sum can handle
them perfectly well. In this case I think the output should also be a float so
that it's clear that precision may have been lost. If the precision of float
is not
what the user wants
Wolfgang Maier added the comment:
Hi Oscar,
well, I haven't used sympy much, and I have no experience with the others, but
in light of your comment I quickly checked sympy and gmpy2.
You are right about them still not using the numbers ABCs, however, on your
advise I also checked how
Wolfgang Maier added the comment:
-Ursprüngliche Nachricht-
Von: Steven D'Aprano [mailto:rep...@bugs.python.org]
Gesendet: Sonntag, 2. Februar 2014 12:55
An: wolfgang.ma...@biologie.uni-freiburg.de
Betreff: [issue20479] Efficiently support weight/frequency mappings
Wolfgang Maier added the comment:
Thanks Nick for filing this!
I've been working on modifications to statistics._sum and
statistics._coerce_types that together make the module's behaviour independent
of the order of input types (by making the decision based on the set of input
types
New submission from Wolfgang Maier:
Hi,
I just noticed that version output generated via the
**'version' action** of the **argparse** module
is routed to stderr. I'd expect regular output to go to stdout instead.
The current behavior also seems inconsistent to me because --help
prints to stdout
201 - 208 of 208 matches
Mail list logo