[issue32589] Statistics as a result from timeit

2018-01-22 Thread Matthias Gilch
Change by Matthias Gilch : -- resolution: -> rejected stage: patch review -> resolved status: -> closed ___ Python tracker ___ ___

[issue32589] Statistics as a result from timeit

2018-01-22 Thread Matthias Gilch
Matthias Gilch added the comment: Steven: Thanks for the advice. Next time I'll follow it Victor: I'll look into perf I see that there are maybe problems and agree that we can close the issue and the PR. -- ___ Python tracker

[issue32589] Statistics as a result from timeit

2018-01-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: If we agree that the patch is wrong, we should reject it and close this issue. -- ___ Python tracker ___ _

[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor
STINNER Victor added the comment: > For you particular need it is easy to write an explicit loop and gather the > statistics that your need. I concur with Serhiy: >>> loops=2**15; values = [value/loops for value in t.repeat(10, loops)] >>> import statistics >>> statistics.mean(values) 3.43941

[issue32589] Statistics as a result from timeit

2018-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Victor. This will defeat the purpose of timeit. And making the type of the result depending on arguments usually means a bad design. For you particular need it is easy to write an explicit loop and gather the statistics that your need. --

[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor
STINNER Victor added the comment: "but after looking more closely at the PR, I see that the statistics gathered are from the (default) 100 runs of each call to timer.timeit()." Ah, don't do that. Timeit runs the same code multiple times and computes the average to compute one value on purpo

[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor
STINNER Victor added the comment: For minimum vs average, see: https://bugs.python.org/issue28240 -- ___ Python tracker ___ ___ Pyth

[issue32589] Statistics as a result from timeit

2018-01-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Jan 19, 2018 at 11:48:46PM +, STINNER Victor wrote: > The timeit module of the stdlib computes 5 values by default... I'm > not sure that it's revelant to compute the standard deviation only on > 5 values. I made the same mistake as that: I too

[issue32589] Statistics as a result from timeit

2018-01-19 Thread STINNER Victor
STINNER Victor added the comment: I suggest you to take a look at my perf project which has a timeit function and command. perf has a different design: it stores all values, and so many statisticals functions can be used. By the way, it does include most common statistical functions in its AP

[issue32589] Statistics as a result from timeit

2018-01-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am also skeptical that this will do more good than harm (by adding time and fostering mis-impressions). (This might better have started as a discussion on python-ideas list.) -- nosy: +terry.reedy, vstinner ___

[issue32589] Statistics as a result from timeit

2018-01-18 Thread Matthias Gilch
Matthias Gilch added the comment: Added sample stdev and variance to the PR -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Matthias Gilch
Matthias Gilch added the comment: Population seemed appropriate to me. I'd define the list of times as a whole "population" that stands for its own. I should probably add both, the sample and population, values. -- ___ Python tracker

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: > What sort of statistics...? I answered my own question... I see that in your PR, you return a dict with the mean, median, *population* variance and standard deviation, and total. Why the population variance/stdev rather than the sample? That seems inappro

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: What sort of statistics, and why do you think they are going to be meaningful? Measurement errors in the timings aren't two-sided, they are only one-sided, which means calculating the mean and standard deviation isn't appropriate. This is documented in the T

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Matthias Gilch
Change by Matthias Gilch : -- keywords: +patch pull_requests: +5076 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue32589] Statistics as a result from timeit

2018-01-17 Thread Matthias Gilch
New submission from Matthias Gilch : I propose to add a function parameter for timeit to get some statistics back from it. I think it's inconvenient to write those stubs every time when we have a method for this in the standard library that could be easily used with a few changes in it. -