Pauli Virtanen pav at iki.fi writes:
...
One question: doesn't this add one extra function call to all umath
functions? Could we do '#define npy_XXX XXX' in the npy_math.h header
when the appropriate platform-specified functions are available?
There shouldn't be overhead on modern compilers
Hi,
I'm trying to use the additional 'title' feature of dtypes when
creating arrays. The reason for using titles is that I want to store
meta data about the columns in them (so do-not-use-titles is not the
right solution for me...)
Everything works fine without titles:
arr = array([('john',
Tue, 24 Feb 2009 14:04:42 +, Neal Becker wrote:
Pauli Virtanen pav at iki.fi writes:
...
One question: doesn't this add one extra function call to all umath
functions? Could we do '#define npy_XXX XXX' in the npy_math.h header
when the appropriate platform-specified functions are
On Tue, Feb 24, 2009 at 7:04 AM, Neal Becker ndbeck...@gmail.com wrote:
Pauli Virtanen pav at iki.fi writes:
...
One question: doesn't this add one extra function call to all umath
functions? Could we do '#define npy_XXX XXX' in the npy_math.h header
when the appropriate
On Wed, Feb 25, 2009 at 2:21 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
In order to inline, the function definition would need to be in the header
and a library version would still be required for passing functions by
address or in case the compiler decided *not* to inline.
I
In fact, the __inline is not helpful. It's the static keyword that
enables the compiler to inline the function if the function is small
enough. As the static indicates that the function will not be seen
from the outside, it can do this.
Matthieu
2009/2/24 David Cournapeau courn...@gmail.com:
On
I ran into this problem as well a few months back.
The reason for the empty residual array when M==N is that the LAPACK
routine for Ax = b puts the solution for x in b. When MN, the
norm-squared is parceled out into the unused (M-N) points in the b
array. When M==N, there's no room for the
Matthieu Brucher wrote:
In fact, the __inline is not helpful. It's the static keyword that
enables the compiler to inline the function if the function is small
enough. As the static indicates that the function will not be seen
from the outside, it can do this.
Depends what is meant by
The inline keyword is never an obligation to inline, it's only a
proposal. And the compiler in fact doesn't care about it. When using
an optimization mode, the compiler will inline the function if it is
simple enough. It's its call. It will even be easier to do so if the
static keyword is used, as
On Tue, Feb 24, 2009 at 11:09 AM, Matthieu Brucher
matthieu.bruc...@gmail.com wrote:
In fact, the __inline is not helpful. It's the static keyword that
enables the compiler to inline the function if the function is small
enough. As the static indicates that the function will not be seen
from
HI all,
I'm having a bit of trouble getting fancy indexing to do what I want.
Say I have a 2-d array:
a
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
[16, 17, 18, 19],
[20, 21, 22, 23]])
I want to extract a sub-array:
On Tue, Feb 24, 2009 at 13:39, Christopher Barker chris.bar...@noaa.gov wrote:
HI all,
I'm having a bit of trouble getting fancy indexing to do what I want.
Say I have a 2-d array:
a
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
The following example:
from numpy import *
a=arange(12).reshape(2,3,2)
b=arange(24).reshape(2,3,2,2)
c=tensordot( a,b,axes=([0,0],[1,1]) )
defaults:
c=tensordot( a,b,axes=([0,0],[1,1]) )
File /usr/lib/python2.4/site-packages/numpy/core/numeric.py, line 359, in
tensordot
raise ValueError,
Robert Kern wrote:
On Tue, Feb 24, 2009 at 13:39, Christopher Barker chris.bar...@noaa.gov
wrote:
a
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
[16, 17, 18, 19],
[20, 21, 22, 23]])
I want to extract a sub-array:
On Tue, Feb 24, 2009 at 1:39 PM, Christopher Barker
chris.bar...@noaa.govwrote:
HI all,
I'm having a bit of trouble getting fancy indexing to do what I want.
Say I have a 2-d array:
a
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
On Tue, Feb 24, 2009 at 2:55 PM, Jose Borreguero borregu...@gmail.com wrote:
The following example:
from numpy import *
a=arange(12).reshape(2,3,2)
b=arange(24).reshape(2,3,2,2)
c=tensordot( a,b,axes=([0,0],[1,1]) )
defaults:
c=tensordot( a,b,axes=([0,0],[1,1]) )
File
On Tuesday 24 February 2009 14:39:39 Christopher Barker wrote:
I'm having a bit of trouble getting fancy indexing to do what I want.
Use ix_:
In [2]: a
Out[2]:
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[12, 13, 14, 15],
[16, 17, 18, 19],
haha, so it was a stupid error...my stupid error. [?]
I incorrectly understood ([0,0],[1,1]) as index 0 of *a* summed with index 0
of *b*, and analogously for [1,1].
Gthanks, Josef
On Tue, Feb 24, 2009 at 3:20 PM, josef.p...@gmail.com wrote:
On Tue, Feb 24, 2009 at 2:55 PM, Jose Borreguero
Hi,
I was just trying to write a docstring for np.dtype.isbuiltin, when I
realized I didn't understand it.
As far as I can see, isbuitin should return:
0 for structured array dtypes
1 for types compiled into numpy
2 for extension types using the numpy C-API type extension machinery.
Here's the
Hi all,
I'm new to mailing list and relatively new (~1 year) to python/numpy. I
would appreciate any insight any of you may have here. The last 8 hours of
digging through the docs has left me, finally, stuck.
I am making a wxPython program that includes webcam functionality. The
script below
On Tue, Feb 24, 2009 at 18:15, Chris Colbert sccolb...@gmail.com wrote:
Hi all,
I'm new to mailing list and relatively new (~1 year) to python/numpy. I
would appreciate any insight any of you may have here. The last 8 hours of
digging through the docs has left me, finally, stuck.
I am
When you do pixeldata[::-1,:,::-1], you just got a new array with
different strides, but now non-contiguous... So I believe you really
need a fresh copy of the data... tostring() copies, but could be
slow... try to use
revpixels = pixeldata[::-1,:,::-1].copy()
...
rgbBMP =
thanks for both answers!
Lisandro, you're right, I should have declared the array outside the loop.
Thanks for catching that!
Robert, as always, thanks for the answer. Quick and to the point! You've
helped me more than once on the enthought list :)
On Tue, Feb 24, 2009 at 8:06 PM, Lisandro
As an update for any future googlers:
the problem was with revpixels = pixeldata[::-1,:,;:-1] which apparently
returns an array that is discontinuous in memory. What Lisandro suggested
worked. pixeldata[::-1,:,;:-1].copy() returns a continuous array object
which natively implements a
On Wed, Feb 25, 2009 at 3:26 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
Good point. However, most of the ufuncs involving standard functions like
sin, cos, etc. are implemented as generic loops that are passed a function
pointer and for such functions the call overhead is probably
Ralph Heinkel wrote:
However here something is strange:
arr = array([('john', 4),('mark', 3)],
dtype=[(('source:yy', 'name'),'O'),(('source:xx','id'),int)])
arr[0]
('john', 4)
arr[0][0]
Traceback (most recent call last):
File stdin, line
Given what you're doing, may I also suggest having a look at
http://code.astraw.com/projects/motmot/wxglvideo.html
-Andrew
Chris Colbert wrote:
As an update for any future googlers:
the problem was with revpixels = pixeldata[::-1,:,;:-1] which apparently
returns an array that is
thanks!
On Wed, Feb 25, 2009 at 1:22 AM, Andrew Straw straw...@astraw.com wrote:
Given what you're doing, may I also suggest having a look at
http://code.astraw.com/projects/motmot/wxglvideo.html
-Andrew
Chris Colbert wrote:
As an update for any future googlers:
the problem was with
28 matches
Mail list logo