ces]
>>
>> t=timeit.Timer("weirdshuffle4(x,ny)", "from __main__ import *")
>> print t.timeit(100)
>>
>> 0.0148663153873
>>
>>
>> -Original Message-
>> From: numpy-discussion-boun...@scipy.org
>> [mailto:numpy-discussion-bo
t=timeit.Timer("weirdshuffle4(x,ny)", "from __main__ import *")
>> print t.timeit(100)
>>
>> 0.0148663153873
>>
>>
>> -Original Message-
>> From: numpy-discussion-boun...@scipy.org
>> [mailto:numpy-discussion-boun...@scipy.
> Sent: Tuesday, February 10, 2009 12:59 PM
> To: Discussion of Numerical Python
> Subject: Re: [Numpy-discussion] Permutations in Simulations`
>
> On Tue, Feb 10, 2009 at 12:41 PM, Keith Goodman wrote:
>> On Tue, Feb 10, 2009 at 12:28 PM, Keith Goodman
>> wrote:
>>>
Tuesday, February 10, 2009 12:59 PM
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Permutations in Simulations`
On Tue, Feb 10, 2009 at 12:41 PM, Keith Goodman wrote:
> On Tue, Feb 10, 2009 at 12:28 PM, Keith Goodman wrote:
>> On Tue, Feb 10, 2009 at 12:18 PM, Kei
Got it. Thanks!
On Tue, Feb 10, 2009 at 1:50 PM, Keith Goodman wrote:
> On Tue, Feb 10, 2009 at 1:41 PM, Mark Miller
> wrote:
>> Out of curiosity, why wouldn't numpy.apply_along_axis be a reasonable
>> approach here. Even more curious: why is it slower than the original
>> explicit loop?
>
>
On Tue, Feb 10, 2009 at 1:41 PM, Mark Miller wrote:
> Out of curiosity, why wouldn't numpy.apply_along_axis be a reasonable
> approach here. Even more curious: why is it slower than the original
> explicit loop?
I took a quick look at the apply_along_axis code. It is numpy code
(not c) and it u
Out of curiosity, why wouldn't numpy.apply_along_axis be a reasonable
approach here. Even more curious: why is it slower than the original
explicit loop?
Learning,
-Mark
import numpy as np
import timeit
def baseshuffle(nx, ny):
x = np.arange(nx)
res = np.zeros((nx,ny),int)
for sim
On Tue, Feb 10, 2009 at 12:41 PM, Keith Goodman wrote:
> On Tue, Feb 10, 2009 at 12:28 PM, Keith Goodman wrote:
>> On Tue, Feb 10, 2009 at 12:18 PM, Keith Goodman wrote:
>>> On Tue, Feb 10, 2009 at 11:29 AM, Mark Janikas wrote:
I want to create an array that contains a column of permutatio
On Tue, Feb 10, 2009 at 12:28 PM, Keith Goodman wrote:
> On Tue, Feb 10, 2009 at 12:18 PM, Keith Goodman wrote:
>> On Tue, Feb 10, 2009 at 11:29 AM, Mark Janikas wrote:
>>> I want to create an array that contains a column of permutations for each
>>> simulation:
>>>
>>> import numpy as NUM
>>>
>
On Tue, Feb 10, 2009 at 12:18 PM, Keith Goodman wrote:
> On Tue, Feb 10, 2009 at 11:29 AM, Mark Janikas wrote:
>> I want to create an array that contains a column of permutations for each
>> simulation:
>>
>> import numpy as NUM
>>
>> import numpy.random as RAND
>>
>> x = NUM.arange(4.)
>>
>> res
On Tue, Feb 10, 2009 at 11:29 AM, Mark Janikas wrote:
> I want to create an array that contains a column of permutations for each
> simulation:
>
> import numpy as NUM
>
> import numpy.random as RAND
>
> x = NUM.arange(4.)
>
> res = NUM.zeros((4,100))
>
>
> for sim in range(100):
>
> res[:,sim] =
Hello All,
I want to create an array that contains a column of permutations for each
simulation:
import numpy as NUM
import numpy.random as RAND
x = NUM.arange(4.)
res = NUM.zeros((4,100))
for sim in range(100):
res[:,sim] = RAND.permutation(x)
Is there a way to do this without a loop? Thank
12 matches
Mail list logo