Re: hw 6 problem 5

0 views
Skip to first unread message

William Stein

unread,
May 13, 2009, 9:04:44 PM5/13/09
to me...@u.washington.edu, 480-uw09
On Wed, May 13, 2009 at 5:30 PM, <me...@u.washington.edu> wrote:
>
> I had a question regarding problem 5.
>
> Here is my code first off:
>
> @interact
> def f(n=(5), k = (1000), regenerate=['Go']):
>   t2 = [[j] for j in range(k)]
>   for u in range(k):
>
>       import random
>       T = finance.TimeSeries([0] + [random.choice([-1,1]) for i in
> range(n)]).sums()
>       t2[u] = T[5]
>   show(finance.TimeSeries(t2).plot_histogram())
>
>
> My question: I can't seem to get a straight frequency histogram to plot, so
> I retired on a Time Series. Is that good enough? If not, how do I get the
> frequency histogram?

Using finance.TimeSeries's plot_histogram is indeed currently the best way to
plot histograms in Sage.

william

Reply all
Reply to author
Forward
0 new messages