[Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Erin Sheldon
Hi everyone - Recarrays have convenience attributes such that fields may be accessed through "." in additioin to the "field()" method. These attributes are designed for read only; one cannot alter the data through them. Yet they are writeable: >>> tr=numpy.recarray(10, formats='i4,f8,f8', names=

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Johannes Loehnert
Hi, > def d4(): > d = zeros([4, 1000], dtype=float) > for i in range(4): > xy = A[i] - B > d[i] = sqrt( sum(xy**2, axis=1) ) > return d > > Maybe there's another alternative to d4? > Thanks again, I think this is the fastest you can get. Maybe it would be nicer to use

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Sebastian Beca
Please replace: C = 4 N = 1000 > d = zeros([C, N], dtype=float) BK. ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Sebastian Beca
Thanks! Avoiding the inner loop is MUCH faster (~20-300 times than the original). Nevertheless I don't think I can use hypot as it only works for two dimensions. The general problem I have is: A = random( [C, K] ) B = random( [N, K] ) C ~ 1-10 N ~ Large (thousands, millions.. i.e. my dataset) K ~

Re: [Numpy-discussion] Array interface updated to Version 3

2006-06-16 Thread Andrew Straw
I noticed in your note labeled 'June 16, 2006' that you refer to the "desc" field. However, in the struct description above, there is only a field named "descr". Also, I suggest that you update the information in the comments of descr field of the structure description to contain the fact that

Re: [Numpy-discussion] Array interface updated to Version 3

2006-06-16 Thread Fernando Perez
On 6/16/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > There is talk of ctypes supporting the new interface which is a worthy > development. Please encourage that if you can. That would certainly be excellent, esp. given how ctypes is slated to be officially part of python 2.5. I think it wou

[Numpy-discussion] Array interface updated to Version 3

2006-06-16 Thread Travis Oliphant
I just updated the array interface page to emphasize we now have version 3. NumPy still supports objects that expose (the C-side) of version 2 of the array interface, though. The new interface is basically the same except (mostly) for asthetics: The differences are listed at the bottom of

[Numpy-discussion] installing numpy and removing numeric-24.1

2006-06-16 Thread Jon Chock
  Sorry, I forgot to mention that I’m working on a Solaris system and installed it in /usr/local/gcc3xbuilt instead of /usr/local.   Thanks.   JC ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sou

[Numpy-discussion] installing numpy and removing numeric-24.

2006-06-16 Thread Jon Chock
  Hi folks!   I’d like to install numpy and remove numeric, are there instructions to remove numeric-24.1?   Thanks.   JC ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/l

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Erin Sheldon
The initial bounces actually say, and I quote: Technical details of temporary failure: TEMP_FAILURE: SMTP Error (state 8): 550-"rejected because your SMTP server, 66.249.92.170, is in the Spamcop RBL. 550 See http://www.spamcop.net/bl.shtml for more information." On 6/16/06, Robert Kern <[EMAIL P

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Andrew Straw
Erin Sheldon wrote: >Anyway - Recarrays have convenience attributes such that >fields may be accessed through "." in additioin to >the "field()" method. These attributes are designed for >read only; one cannot alter the data through them. >Yet they are writeable: > > > tr=numpy.recarray(10,

Re: [Numpy-discussion] Array Protocol change for Python 2.6

2006-06-16 Thread Travis Oliphant
Thomas Heller wrote: > Robert Kern wrote: > >> Francesc Altet wrote: >> >>> A Divendres 09 Juny 2006 11:54, Albert Strasheim va escriure: >>> >>> Just out of curiosity: In [1]: x = N.array([]) In [2]: x.__array_data__ Out[2]: ('0x01C23EE0', False) >

[Numpy-discussion] Sourceforge and gmail [was: Re: Recarray attributes writeable]

2006-06-16 Thread Robert Kern
Robert Kern wrote: > Erin Sheldon wrote: > >>Hi everyone - >> >>(this is my fourth try in the last 24 hours to post this. >>Apparently, the gmail smtp server is in the blacklist!! >>this is bad). > > I doubt it since that's where my email goes through. And of course that's utterly bogus since I

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Robert Kern
Erin Sheldon wrote: > Hi everyone - > > (this is my fourth try in the last 24 hours to post this. > Apparently, the gmail smtp server is in the blacklist!! > this is bad). I doubt it since that's where my email goes through. Sourceforge is frequently slow, so please have patience if your mail doe

[Numpy-discussion] Recarray attributes writeable (3rd try)

2006-06-16 Thread Erin Sheldon
Hi everyone - (this is my third try in the last 24 hours to post this. For some reason it hasn't been making it through) Recarrays have convenience attributes such that fields may be accessed through "." in additioin to the "field()" method. These attributes are designed for read only; one canno

[Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Erin Sheldon
Hi everyone - (this is my fourth try in the last 24 hours to post this. Apparently, the gmail smtp server is in the blacklist!! this is bad). Anyway - Recarrays have convenience attributes such that fields may be accessed through "." in additioin to the "field()" method. These attributes are des

Re: [Numpy-discussion] Array Interface

2006-06-16 Thread Thomas Heller
Travis Oliphant wrote: > Thanks for the continuing discussion on the array interface. > > I'm thinking about this right now, because I just spent several hours > trying to figure out if it is possible to add additional > "object-behavior" pointers to a type by creating a metatype that > sub-typ

Re: [Numpy-discussion] Array Protocol change for Python 2.6

2006-06-16 Thread Francesc Altet
A Divendres 16 Juny 2006 21:25, Thomas Heller va escriure: > Robert Kern wrote: > > Like how Win64 uses 32-bit longs and 64-bit pointers. And then there's > > signedness. Please don't use Python ints to encode pointers. Holding > > arbitrary pointers is the job of CObjects. > > (Sorry, I'm late in

Re: [Numpy-discussion] Array Protocol change for Python 2.6

2006-06-16 Thread Thomas Heller
Robert Kern wrote: > Francesc Altet wrote: >> A Divendres 09 Juny 2006 11:54, Albert Strasheim va escriure: >> >>>Just out of curiosity: >>> >>>In [1]: x = N.array([]) >>> >>>In [2]: x.__array_data__ >>>Out[2]: ('0x01C23EE0', False) >>> >>>Is there a reason why the __array_data__ tuple stores the

Re: [Numpy-discussion] Segfault with simplest operation on extensionmodule using numpy

2006-06-16 Thread Albert Strasheim
Hey Glen http://www.scipy.org/Cookbook/C_Extensions covers most of the boilerplate you need to get started with extension modules. Regards, Albert > -Original Message- > From: [EMAIL PROTECTED] [mailto:numpy- > [EMAIL PROTECTED] On Behalf Of Glen W. Mabey > Sent: 16 June 2006 18:24 > T

[Numpy-discussion] tiny patch + Playing with strings and my own array descr (PyArray_STRING, PyArray_OBJECT).

2006-06-16 Thread Matthieu Perrot
hi, I need to handle strings shaped by a numpy array whose data own to a C structure. There is several possible answers to this problem : 1) use a numpy array of strings (PyArray_STRING) and so a (char *) object in C. It works as is, but you need to define a maximum size to your strings beca

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Tim Hochberg
Christopher Barker wrote: >Bruce Southey wrote: > > >>Please run the exact same code in Matlab that you are running in >>NumPy. Many of Matlab functions are very highly optimized so these are >>provided as binary functions. I think that you are running into this >>so you are not doing the correc

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Christopher Barker
Bruce Southey wrote: > Please run the exact same code in Matlab that you are running in > NumPy. Many of Matlab functions are very highly optimized so these are > provided as binary functions. I think that you are running into this > so you are not doing the correct comparison He is doing the cor

Re: [Numpy-discussion] Segfault with simplest operation on extension module using numpy

2006-06-16 Thread Robert Kern
Glen W. Mabey wrote: > That is, when I run: > import DFALG > DFALG.bsvmdf( 3 ) > after compiling the below code, it always segfaults, regardless of the > type of the argument given. Just as a sanity check (it's been a little > while since I have written an extension module for Python) I c

[Numpy-discussion] Segfault with simplest operation on extension module using numpy

2006-06-16 Thread Glen W. Mabey
Hello, I am writing a python extension module to create an interface to some C code, and am using numpy array as the object type for transferring data back and forth. Using either the numpy svn from yesterday, or 0.9.6 or 0.9.8, with or without optimized ATLAS installation, I get a segfault at w

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Tim Hochberg
Sasha wrote: >On 6/16/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: > > >> >>Abbreviations will emerge anyway, the question is merely: Will numpy >>provide/recommend them (in addition to having long names maybe), or will >>it have to be done by somebody else, possibly resulting in many >>dif

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Alan G Isaac
On Fri, 16 Jun 2006, Sven Schreiber apparently wrote: > Abbreviations will emerge anyway, the question is merely: > Will numpy provide/recommend them (in addition to having > long names maybe), or will it have to be done by somebody > else, possibly resulting in many different sets of > abbrev

Re: [Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Bruce Southey
Hi, Please run the exact same code in Matlab that you are running in NumPy. Many of Matlab functions are very highly optimized so these are provided as binary functions. I think that you are running into this so you are not doing the correct comparison So the ways around it are to write an extensi

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Sasha
On 6/16/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: > > Abbreviations will emerge anyway, the question is merely: Will numpy > provide/recommend them (in addition to having long names maybe), or will > it have to be done by somebody else, possibly resulting in many > different sets of abbrev

Re: [Numpy-discussion] distance matrix speed

2006-06-16 Thread Tim Hochberg
Sebastian Beca wrote: >Hi, >I'm working with NumPy/SciPy on some algorithms and i've run into some >important speed differences wrt Matlab 7. I've narrowed the main speed >problem down to the operation of finding the euclidean distance >between two matrices that share one dimension rank (dist in M

[Numpy-discussion] Numpy svn not installing headers

2006-06-16 Thread Matt Hyclak
I was trying to build matplotlib after installing the latest svn version of numpy (r2426), and compilation bailed on missing headers. It seems that the headers from build/src.linux*/numpy/core/ are not properly being installed during setup.py's install phase to $PYTHON_SITE_LIB/site-packages/numpy/

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Tim Hochberg
I don't have anything constructive to add at the moment, so I'll just throw out an unelucidated opinion: +1 for longish names. -1 for two sets of names. -tim ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sou

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Sven Schreiber
Alexandre Fayolle schrieb: > On Fri, Jun 16, 2006 at 10:43:42AM +0200, Sven Schreiber wrote: >>> Again, there is no defense for abbreviating linear_least_squares >>> because it is unlikely to appear in an expression and waste valuable >>> horisontal space. >> not true imho; btw, I would suggest "

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Alexandre Fayolle
On Fri, Jun 16, 2006 at 10:43:42AM +0200, Sven Schreiber wrote: > > Again, there is no defense for abbreviating linear_least_squares > > because it is unlikely to appear in an expression and waste valuable > > horisontal space. > > not true imho; btw, I would suggest "ols" (ordinary least square

[Numpy-discussion] ImportError while creating a Python module using NumPy

2006-06-16 Thread Pierre Barbier de Reuille
Hi, I have an extension library which I wanted to interface with NumPy ... So I added the import_array() and all the needed stuff so that it now compiles. However, when I load the library I obtain : ImportError: No module named core.multiarray I didn't find anything on the net about it, what cou

[Numpy-discussion] Test post - ignore

2006-06-16 Thread Sebastian Beca
Please ignore if you recieve this. ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion

[Numpy-discussion] Distance Matrix speed

2006-06-16 Thread Sebastian Beca
Hi, I'm working with NumPy/SciPy on some algorithms and i've run into some important speed differences wrt Matlab 7. I've narrowed the main speed problem down to the operation of finding the euclidean distance between two matrices that share one dimension rank (dist in Matlab): Python: def dtest()

Re: [Numpy-discussion] Don't like the short names like lstsq and irefft

2006-06-16 Thread Sven Schreiber
Alexander Belopolsky schrieb: > In my view it is more important that code is easy to read rather than > easy to write. Interactive users will disagree, but in programming you > write once and read/edit forever :). The insight about this disagreement imho suggests a compromise (or call it a dual s

Re: [Numpy-discussion] distance matrix speed

2006-06-16 Thread David Douard
Hi, On Fri, Jun 16, 2006 at 08:28:18AM +0200, Johannes Loehnert wrote: > Hi, > > def dtest(): >     A = random( [4,2]) >     B = random( [1000,2]) > > # drawback: memory usage temporarily doubled > # solution see below > d = A[:, newaxis, :] - B[newaxis, :, :] Unless I'm wrong, one