Re: [Numpy-discussion] array gymnastics

2008-09-11 Thread Alan Jackson
Thanks! I think I figured that out about a year ago, and I couldn't remember what I had done. On Fri, 12 Sep 2008 04:57:46 +0300 "Nadav Horesh" <[EMAIL PROTECTED]> wrote: > or > hstack((a.T, b[:,None])) > >Nadav. > > > -הודעה מקורית- > מאת: [EMAIL PROTECTED] בשם Brent Pedersen > נ

Re: [Numpy-discussion] array gymnastics

2008-09-11 Thread Nadav Horesh
or hstack((a.T, b[:,None])) Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Brent Pedersen נשלח: ו 12-ספטמבר-08 04:19 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] array gymnastics On Thu, Sep 11, 2008 at 6:03 PM, Alan Jackson <[EMAIL PROTECTED]> wrote: > There h

Re: [Numpy-discussion] array gymnastics

2008-09-11 Thread Brent Pedersen
On Thu, Sep 11, 2008 at 6:03 PM, Alan Jackson <[EMAIL PROTECTED]> wrote: > There has got to be a simple way to do this, but I'm just not seeing it. > a = array([[1,2,3,4,5,6], > [7,8,9,10,11,12]]) b = array([21,22,23,24,25,26]) > > What I want to end up with is : > > c = arra

[Numpy-discussion] array gymnastics

2008-09-11 Thread Alan Jackson
There has got to be a simple way to do this, but I'm just not seeing it. >>> a = array([[1,2,3,4,5,6], [7,8,9,10,11,12]]) >>> b = array([21,22,23,24,25,26]) What I want to end up with is : c = array([[1,7,21], [2,8,22], .. [6,12,26]]) -- ---

Re: [Numpy-discussion] Numpy array flags - BUG?

2008-09-11 Thread Travis E. Oliphant
Thomas Hrabe wrote: > Hello everyone, > > I must report odd behaviour of the numpy arrays regarding the flags set for > each array object in C++. > Please have a look at the following code: > > static PyObject* test(PyObject* self,PyObject* args){ > > int s[2]; > s[0] = 1; >

[Numpy-discussion] C to Fortran Conversion

2008-09-11 Thread Thomas Hrabe
Hi all, this post might not really belong into this forum, but as the functions I am looking for are member of numpy, I thought I might drop a message at this point. I am looking for some functions/ a library converting C aligned arrays to Fortran, due to the flags problem I mentioned recently in

Re: [Numpy-discussion] Numpy array flags - BUG?

2008-09-11 Thread Thomas Hrabe
I tried another approach, creating an array in python with >>>import numpy; >>>a = numpy.zeros((2,2),order="C"); >>>a.flags.num 1285 and setting the flags within C++ to 1286. The value remains the same (1285) after setting it to 1286 in embedded C. PyArg_ParseTuple(args, "O!",&PyArray_Type, &ar

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 24, Issue 32

2008-09-11 Thread Robert Kern
On Thu, Sep 11, 2008 at 17:01, Catherine Moroney <[EMAIL PROTECTED]> wrote: > I'm able to remove the file using python's "os" module, but > I still get an error when trying to create the file using > pyhdf, this time specifiying "SD.SDC.CREATE|SD.SDC.WRITE" > on the file-create line. > > It's still

Re: [Numpy-discussion] Has any one out there ever worked with the Rpyc, which is a remote process call for python

2008-09-11 Thread Robert Kern
On Thu, Sep 11, 2008 at 17:01, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To All, > > > Has any one out there ever worked with the Rpyc, which is a remote > process call for python? Please do not cross-post. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmle

[Numpy-discussion] Has any one out there ever worked with the Rpyc, which is a remote process call for python

2008-09-11 Thread Blubaugh, David A.
To All, Has any one out there ever worked with the Rpyc, which is a remote process call for python? David Blubaugh This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 24, Issue 32

2008-09-11 Thread Catherine Moroney
I'm able to remove the file using python's "os" module, but I still get an error when trying to create the file using pyhdf, this time specifiying "SD.SDC.CREATE|SD.SDC.WRITE" on the file-create line. It's still complaining that it can't open the path, even though the specified filename is valid.

Re: [Numpy-discussion] F2py errors still

2008-09-11 Thread Robert Kern
On Thu, Sep 11, 2008 at 16:42, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To All, > > I am still not sure as to why this is not working. I believe it could > be my windows environment variables. However, I have set these > variables based on the following webpage: > > > http://www.scipy.org/

[Numpy-discussion] F2py errors still

2008-09-11 Thread Blubaugh, David A.
To All, I am still not sure as to why this is not working. I believe it could be my windows environment variables. However, I have set these variables based on the following webpage: http://www.scipy.org/F2PY_Windows The error that I obtain is the following: C:\python25\python C:\python25

[Numpy-discussion] Numpy array flags - BUG?

2008-09-11 Thread Thomas Hrabe
Hello everyone, I must report odd behaviour of the numpy arrays regarding the flags set for each array object in C++. Please have a look at the following code: static PyObject* test(PyObject* self,PyObject* args){ int s[2]; s[0] = 1; s[1] = 1; char* value = (cha

Re: [Numpy-discussion] creating or truncating SD files in pyhdf

2008-09-11 Thread Robert Kern
On Thu, Sep 11, 2008 at 15:54, Catherine Moroney <[EMAIL PROTECTED]> wrote: > What is the correct way to create an SD file (if it doesn't already > exist), > or truncate and then rewrite an existing one? I would suggest testing with os.path.exists() first, then deciding whether to use TRUNC or not

[Numpy-discussion] creating or truncating SD files in pyhdf

2008-09-11 Thread Catherine Moroney
What is the correct way to create an SD file (if it doesn't already exist), or truncate and then rewrite an existing one? Does it matter which order the file-access options are set? For instance, here's my code: self.flhdf_stereo = SD.SD(flname_stereo, \ SD.SDC.TRU

Re: [Numpy-discussion] NumPy arrays that use memory allocated from other libraries or tools

2008-09-11 Thread Lisandro Dalcin
On Wed, Sep 10, 2008 at 4:55 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/9/10 Travis E. Oliphant <[EMAIL PROTECTED]>: >> The post is >> >> http://blog.enthought.com/?p=62 > > Very cool post, thank you! I agree that it would be great to have > such a mechanism in NumPy. > And then bu

Re: [Numpy-discussion] f2py related question

2008-09-11 Thread Charles Doutriaux
Thanks robert, That's exactly the information I needed. Thanks for the link too. C. Robert Kern wrote: > On Thu, Sep 11, 2008 at 14:12, Charles Doutriaux <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I have a quick question that I'm hoping f2py developpers will be able to >> quickly answer >>

Re: [Numpy-discussion] Pb while compiling numpy svn

2008-09-11 Thread Pierre GM
On Wednesday 10 September 2008 12:47:26 you wrote: > All, > I can't compile the latest SVN on my machine. You'll find the corresponding > error message at the end. Sorry for the noise, my local checkout was borked... ___ Numpy-discussion mailing list Num

Re: [Numpy-discussion] f2py related question

2008-09-11 Thread Robert Kern
On Thu, Sep 11, 2008 at 14:12, Charles Doutriaux <[EMAIL PROTECTED]> wrote: > Hello, > > I have a quick question that I'm hoping f2py developpers will be able to > quickly answer > > I have some C code, input type can be either int or long > I'm trying to write some fortran interface to it > > my u

Re: [Numpy-discussion] Still having issues with f2py

2008-09-11 Thread Blubaugh, David A.
Uwe, I have tried your example and it look as though it would have worked. However, I did obtain the following error!!! python25> python setup.py build -cmingw32 running build running scons customize Mingw32CCompiler Found executable C:\gfortran\bin\gcc.exe Ignoring "Python was built with Visu

[Numpy-discussion] f2py related question

2008-09-11 Thread Charles Doutriaux
Hello, I have a quick question that I'm hoping f2py developpers will be able to quickly answer I have some C code, input type can be either int or long I'm trying to write some fortran interface to it my understanding is that integer in fortran corresponds to int integer(kind=2) matches short b

Re: [Numpy-discussion] cross product of two vectors as sets

2008-09-11 Thread Alan G Isaac
Set product could be produced as:: dp = list((xi,yi) for xi in x for yi in y) dpasarray = np.array(dp) but unless you really need the array, you can use a generator. Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://

[Numpy-discussion] cross product of two vectors as sets

2008-09-11 Thread Uwe Schmitt
Hi, I want to calculate the crossproduct (from set theory, not vectorspace crossproduct) of two vectors x,y. My method is as follows: >>> x = array([1,2,3]) >>> y = array([4,5]) >>> xx, yy = meshgrid(x,y) >>> array(zip(xx.flatten(), yy.flatten())) array([[1, 4], [2, 4], [3, 4]

Re: [Numpy-discussion] Still having issues with f2py

2008-09-11 Thread Uwe Schmitt
On 11 Sep., 02:33, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > Mark, > ...  I > was also wondering as to what is involved with "compiling with MingW32, > by passing "-c mingw32" to setup.py."?? If you do not have the right MS compiler on your machine, you can use the mingw port of gcc inst