William Stein
unread,Feb 11, 2020, 1:37:05 PM2/11/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Harald Schilly, Ingo Dahn, CoCalc, Frédéric Chapoton, Frédéric Chapoton
On Tue, Feb 11, 2020 at 9:33 AM Harald Schilly <
h...@sagemath.com> wrote:
>
> Well, I can't find that example, or a similar one. I don't know if this is a bug or it just happened to work.
Ingo -- thanks for finding this. It is definitely a bug. It is a bug
that Frédéric Chapoton introduced into a recent version of Sage when
doing some automated cleanup of the source code:
https://github.com/sagemath/sage/commit/c946256d9a2dce49beaef6b28c6e36df9a0a2b4b#diff-d0fae2d422c3c6f113110121d9faa9a6R219
I've cc'd Frédéric so he can fix this.
I guess this is one of the drawbacks of automated style suggestion
software; it suggests changes that look good at first glance, but can
break code. Your example should be a doctest.
This is a workaround in the current version of Sage:
sage: std([RR(random()) for i in [1 .. 20]])
0.291469277800344
However, it is slower. Harald's suggestion to convert to a numpy
array would be faster.
In case anybody is curious all these basic stats functions were first
written by Andrew Hou (
https://github.com/amhou) as a univ. of
Washington undergrad student project... They really do have value
because they work on any number types (e.g., symbolics, etc.).
> To view this discussion on the web visit
https://groups.google.com/d/msgid/cocalc/CA%2BCu88QiKa%2B1tnaUvrfYgM6jzsZEzZ5gsQ6X25jPjvo%3DCFv8-Q%40mail.gmail.com.
--
Best Regards,
William Stein
CEO, SageMath, Inc.