On Sun, 21 Feb 2010 03:22:19 am Andrew Fithian wrote:
> Hi tutor,
>
> I'm have a statistical bootstrapping script that is bottlenecking on
> a python function sample_with_replacement(). I wrote this function
> myself because I couldn't find a similar function in python's random
> library.
random.
Luke Paireepinart wrote:
Can you explain what your function is doing and also post some test code to
profile it?
On Sat, Feb 20, 2010 at 10:22 AM, Andrew Fithian wrote:
Hi tutor,
I'm have a statistical bootstrapping script that is bottlenecking on a
python function sample_with_replaceme
On Sat, Feb 20, 2010 at 1:50 PM, Kent Johnson wrote:
> On Sat, Feb 20, 2010 at 11:22 AM, Andrew Fithian
> wrote:
> > can
> > you help me speed it up even more?
> > import random
> > def sample_with_replacement(list):
> > l = len(list) # the sample needs to be as long as list
> > r = xra
On Sat, Feb 20, 2010 at 11:22 AM, Andrew Fithian wrote:
> can
> you help me speed it up even more?
> import random
> def sample_with_replacement(list):
> l = len(list) # the sample needs to be as long as list
> r = xrange(l)
> _random = random.random
> return [list[int(_random()*l
Can you explain what your function is doing and also post some test code to
profile it?
On Sat, Feb 20, 2010 at 10:22 AM, Andrew Fithian wrote:
> Hi tutor,
>
> I'm have a statistical bootstrapping script that is bottlenecking on a
> python function sample_with_replacement(). I wrote this functio