On Mon, Dec 20, 2010 at 10:19 PM, Alan G Isaac wrote:
> On 12/20/2010 9:41 PM, josef.p...@gmail.com wrote:
>> python has it in random
>>
>> sample( population, k)
>
>
> Yes, I mentioned this in my original post:
> http://www.mail-archive.com/numpy-discussion@scipy.org/msg29324.html
>
> But good si
On 12/20/2010 9:41 PM, josef.p...@gmail.com wrote:
> python has it in random
>
> sample( population, k)
Yes, I mentioned this in my original post:
http://www.mail-archive.com/numpy-discussion@scipy.org/msg29324.html
But good simulation practice is perhaps to seed
a simulation specific random num
On Mon, Dec 20, 2010 at 11:28 AM, Alan G Isaac wrote:
> I want to sample *without* replacement from a vector
> (as with Python's random.sample). I don't see a direct
> replacement for this, and I don't want to carry two
> PRNG's around. Is the best way something like this?
>
> permutatio
On Fri, Dec 17, 2010 at 10:16 PM, Fernando Perez wrote:
> Howdy,
>
> In the ipython doc guide (and many other places) we point to the numpy
> coding guidelines (especially for documentation), but today while
> conducting a sprint at the Scipy India conference, I noticed this
> link is now dead:
>
ma, 2010-12-20 kello 15:32 -0700, Justin Peel kirjoitti:
> I'm using version 2.0.0.dev8716, which should be new enough I would
> think. Let me show you what makes me think that there isn't
> short-circuiting going on.
>
> I'll do two timeit's from the command line:
>
> $ python -m timeit -s 'imp
Oh, you're quite right. I should have looked more closely into this.
Thanks for the reply.
On Mon, Dec 20, 2010 at 2:15 PM, Charles R Harris
wrote:
>
>
> On Mon, Dec 20, 2010 at 1:25 PM, Justin Peel wrote:
>>
>> I noticed that there is currently no way to reverse a numpy array
>> in-place. The c
I'm using version 2.0.0.dev8716, which should be new enough I would
think. Let me show you what makes me think that there isn't
short-circuiting going on.
I'll do two timeit's from the command line:
$ python -m timeit -s 'import numpy as np; x = np.ones(20)' 'x.all()'
100 loops, best of 3: 3
A while ago, I asked a whether it was possible to multi-iterate over several
ndarrays but exclude a certain axis(
http://www.mail-archive.com/numpy-discussion@scipy.org/msg29204.html), sort
of a combination of PyArray_IterAllButAxis and PyArray_MultiIterNew. My goal
was to allow creation of relativ
On Mon, Dec 20, 2010 at 1:25 PM, Justin Peel wrote:
> I noticed that there is currently no way to reverse a numpy array
> in-place. The current way to reverse a numpy array is using slicing,
> ala arr[::-1]. This is okay for small matrices, but for really large
> ones, this can be prohibitive. No
On Mon, Dec 20, 2010 at 1:25 PM, Justin Peel wrote:
> It has come to my attention that the all() and any() methods/functions
> do not short circuit. It takes nearly as much time to call any() on an
> array which has 1 as the first entry as it does to call it on an array
> of the same size full of
On 12/8/2010 9:48 AM, josef.p...@gmail.com wrote:
> Just a thought since I'm not doing spatial statistics.
>
> If you can create (integer) labels that assigns each point to a zone,
> then you can treat it essentially as a 1d grouped data, and you could
> use np.bincount to calculate some statistics
It has come to my attention that the all() and any() methods/functions
do not short circuit. It takes nearly as much time to call any() on an
array which has 1 as the first entry as it does to call it on an array
of the same size full of zeros.
The cause of the problem is that all() and any() just
I noticed that there is currently no way to reverse a numpy array
in-place. The current way to reverse a numpy array is using slicing,
ala arr[::-1]. This is okay for small matrices, but for really large
ones, this can be prohibitive. Not only that, but an in-place reverse
is much faster than slici
I think this is not possible to do efficiently with just numpy. If you want
to do this efficiently, I wrote a no-replacement sampler in Cython some time
ago (below). I hearby release it to the public domain.
'''
Created on Oct 24, 2009
http://stackoverflow.com/questions/311703/algorithm-for-sampl
Howdy,
In the ipython doc guide (and many other places) we point to the numpy
coding guidelines (especially for documentation), but today while
conducting a sprint at the Scipy India conference, I noticed this
link is now dead:
http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines
It seems
I need to calculate several products of matrices where
at least one of them is always hermitian. The function
zhemm (in blas, level 3) seems to directly do that in
an efficient manner.
However ... how can i access that function and dirctly apply
it on numpy arrays?
If you know alternatives that a
I want to sample *without* replacement from a vector
(as with Python's random.sample). I don't see a direct
replacement for this, and I don't want to carry two
PRNG's around. Is the best way something like this?
permutation(myvector)[:samplesize]
Thanks,
Alan Isaac
On Mon, 13 Dec 2010 16:39:20 -0500, Kathleen M Tacina wrote:
> I've been finding numpy/scipy/matplotlib a very useful tool for data
> analysis. However, a recent change has caused me some problems.
>
> Numpy used to allow the name and title of a column of a structured array
> or recarray to be th
18 matches
Mail list logo