Mark Janikas wrote:
> Hello All,
>
>
>
> I was exploring some different ways to concatenate arrays, and using
> “c_” is the fastest by far. Is there a difference I am missing that can
> account for the huge disparity? Obviously the “zip” function makes the
> “as array” and “array” calls sl
Hello All,
I was exploring some different ways to concatenate arrays, and using "c_" is
the fastest by far. Is there a difference I am missing that can account for
the huge disparity? Obviously the "zip" function makes the "as array" and
"array" calls slower, but the same arguments (xCoords,
2009/4/30 David Warde-Farley :
> Have you considered coding up a looped version in Cython? If this is
> going to be a bottleneck then it would be very worthwhile. Stéfan's
> code is clever, although as he points out, it will create an
> intermediate array of size (len(I))**2, which may end up being
2009/4/29 Dan Goodman :
> Robert Kern wrote:
>> On Wed, Apr 29, 2009 at 16:19, Dan Goodman wrote:
>>> Robert Kern wrote:
On Wed, Apr 29, 2009 at 08:03, Daniel Yarlett
wrote:
> As you can see, Current is different in the two cases. Any ideas how I
> can recreate the behavio
David Warde-Farley wrote:
> On 29-Apr-09, at 5:49 PM, Dan Goodman wrote:
>
>> Thanks David, that's nice but unfortunately that Python loop will kill
>> me. I'm thinking about some simulation code I'm writing where this
>> operation will be carried out many, many times, with large arrays I. I
>> fi
Stéfan van der Walt wrote:
> 2009/4/29 Dan Goodman :
>> Here's the problem I want to write vectorised code for. I start with an
>> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
>> with an array C that counts how many times each index has been seen so
>> far if you were count
On 29-Apr-09, at 5:49 PM, Dan Goodman wrote:
> Thanks David, that's nice but unfortunately that Python loop will kill
> me. I'm thinking about some simulation code I'm writing where this
> operation will be carried out many, many times, with large arrays I. I
> figure I need to keep the Python ove
Robert Kern wrote:
> On Wed, Apr 29, 2009 at 16:19, Dan Goodman wrote:
>> Robert Kern wrote:
>>> On Wed, Apr 29, 2009 at 08:03, Daniel Yarlett
>>> wrote:
>>>
As you can see, Current is different in the two cases. Any ideas how I
can recreate the behavior of the iterative process in a m
On Wed, Apr 29, 2009 at 16:19, Dan Goodman wrote:
> Robert Kern wrote:
>> On Wed, Apr 29, 2009 at 08:03, Daniel Yarlett
>> wrote:
>>
>>> As you can see, Current is different in the two cases. Any ideas how I
>>> can recreate the behavior of the iterative process in a more numpy-
>>> friendly, ve
David Warde-Farley wrote:
> On 29-Apr-09, at 5:06 PM, Dan Goodman wrote:
>
>> Here's the problem I want to write vectorised code for. I start with
>> an
>> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
>> with an array C that counts how many times each index has been seen
2009/4/29 Dan Goodman :
> Here's the problem I want to write vectorised code for. I start with an
> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
> with an array C that counts how many times each index has been seen so
> far if you were counting through the array from the be
On 29-Apr-09, at 5:06 PM, Dan Goodman wrote:
> Here's the problem I want to write vectorised code for. I start with
> an
> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
> with an array C that counts how many times each index has been seen so
> far if you were counting th
Robert Kern wrote:
> On Wed, Apr 29, 2009 at 08:03, Daniel Yarlett
> wrote:
>
>> As you can see, Current is different in the two cases. Any ideas how I
>> can recreate the behavior of the iterative process in a more numpy-
>> friendly, vectorized (and hopefully quicker) way?
>
> Use bincount().
Hi all,
Here's the problem I want to write vectorised code for. I start with an
array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
with an array C that counts how many times each index has been seen so
far if you were counting through the array from the beginning to the
end,
On Wed, Apr 29, 2009 at 08:03, Daniel Yarlett wrote:
> As you can see, Current is different in the two cases. Any ideas how I
> can recreate the behavior of the iterative process in a more numpy-
> friendly, vectorized (and hopefully quicker) way?
Use bincount().
> And possibly also
> about why
> As you can see, Current is different in the two cases. Any ideas how I
> can recreate the behavior of the iterative process in a more numpy-
> friendly, vectorized (and hopefully quicker) way? And possibly also
> about why my intuitions concerning the semantics of the vectorized
> code are
Thanks Chris and Stefan,
In the end, I'm going to take both your advice and not do this after
all. Actually I worked out another way to do the same thing.
Essentially, rather than store a pointer I store a reference to the
array, and an array of indices in that array. Much safer and the things
Dan Goodman wrote:
> (because I want to construct the 1D arrays X, Y above from values picked
> from a variety of possible data structures, including dense and sparse
> 2D arrays, but in such a way that the code that uses these values
> doesn't have to know where the values came from in these da
Hi Zach,
Zachary Pincus schrieb:
> According to http://www.pygtk.org/pygtk2reference/class-
> gdkpixbuf.html , the pixels_array is a numeric python array (a
> predecessor to numpy). The upshot is that perhaps the nice
> broadcasting machinery will work fine:
>
> pb_pixels[...] = fits_pixels
2009/4/29 Stéfan van der Walt :
> 2009/4/29 Robin :
>> I have been using seterr to try to catch where Nans are appearing in
>> my analysis.
>>
>> I used all: 'warn' which worked the first time I ran the function, but
>> as specified in the documentation it only warns 'once only'. Is there
>> a way
Most of the time, it just needs the largest or smallest eigenvalues/vectors.
But unfortunately, it needs more.
Thanks.
2009-04-29
Zhenxin Zhan
发件人: Sebastian Walter
发送时间: 2009-04-29 02:17:38
收件人: Discussion of Numerical Python
抄送:
主题: Re: [Numpy-discussion] MemoryError for computin
2009/4/29 Robin :
> I have been using seterr to try to catch where Nans are appearing in
> my analysis.
>
> I used all: 'warn' which worked the first time I ran the function, but
> as specified in the documentation it only warns 'once only'. Is there
> a way I can reset the count so it will warn ag
It's kind of characterizing the dynamics of virus spreading in arbitrary
networks. It uses Markov knowledge.
There are a lot of complicated mathmatics equations.
2009-04-29
Zhenxin Zhan
发件人: Charles R Harris
发送时间: 2009-04-29 02:09:57
收件人: Discussion of Numerical Python
抄送:
主题: Re:
Hi,
I have been using seterr to try to catch where Nans are appearing in
my analysis.
I used all: 'warn' which worked the first time I ran the function, but
as specified in the documentation it only warns 'once only'. Is there
a way I can reset the count so it will warn again, without loosing my
Hi All,
I'm coding an iterative algorithm which needs to update a results
array on each iteration. I have several (one-dimensional) arrays, and
currently I have the following non-vectorized code which gets called
at the end of each iteration (Inds, Current, and Update are all one-
dimension
Stéfan van der Walt wrote:
>
> I see a number of docstrings already have
>
> .. versionadded:: 1.3.0
>
Yes, but I don't think it is enough. In particular, I don't like so much
the fact that the C API documentation for every function is separate
from the code. There are several mismatches betwee
Hi Dan
2009/4/29 Dan Goodman :
> I have a slightly strange idea for something I would like to do with
> numpy which I guess probably doesn't exist, but I may be wrong. What I
> want to do, essentially, is to have two arrays of equal size, say X and
> Y, of pointers to doubles say. Then I want to d
+1 to that
Often, one is only interested in the largest or smallest
eigenvalues/vectors of a problem. Then the method of choice are
iterative solvers, e.g. Lanczos algorithm.
If only the largest eigenvalue/vector is needed, you could try the
power iteration.
On Wed, Apr 29, 2009 at 7:49 AM, Zh
2009/4/29 David Cournapeau :
> Stéfan van der Walt wrote:
>> We can already do this: simply choose a convention for NPY_VERSION and
>> NPY_FEATURE_VERSION so that they are related.
>
> By tracking, I meant more than just the actual number in the source
> code, like something in the documentation. S
On Tue, Apr 28, 2009 at 11:49 PM, Zhenxin Zhan wrote:
> Thanks. My mistake.
>
> The os is 32-bit. I am doing a network-simulation for my teacher. The
> average degree of the network topology is about 6.0. So I think it is
> sparse.
>
> The paper needs the eigen values and the eigen vectors which
30 matches
Mail list logo