[Numpy-discussion] Undelivered Mail Returned to Sender

2006-08-14 Thread Mail Delivery System
This is the Postfix program at host rosi.szbk.u-szeged.hu. I'm sorry to have to inform you that your message could not be be delivered to one or more recipients. It's attached below. For further assistance, please send mail to If you do so, please include this problem report. You can delete you

Re: [Numpy-discussion] SciPy 2006 LiveCD torrent is available

2006-08-14 Thread ainulinde
FYI, I chang my bt client from bitcomet to uTorrent, and it works now. and I have downloaded the iso by http://blabla. in the vmware vitural machine, the livecd boot and i can use ipython/import numpy... is there any more feature or special scipy conference stuff on the cd? On 8/11/06, ainulinde <

Re: [Numpy-discussion] SciPy 2006 LiveCD torrent is available

2006-08-14 Thread Bryce Hendrix
The Live CD is meant to be paired with the tutorial sessions, but contains just the latest builds + svn checkouts. Once the tutorials are available, we should add them to the same wiki page for downloading. I built the CD's in a VMWare virtual machine, if anyone is interested in the VMWare imag

[Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Matthew Brett
Hi, I am sorry if this is obvious, but: I am working on the scipy loadmat module, and would like to use numpy to reformat the fortran order arrays that matlab saves. I was not sure how to do this, and would like to ask for advice. Let us say that I have some raw binary data as a string. The da

Re: [Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Travis Oliphant
Matthew Brett wrote: > Hi, > > I am sorry if this is obvious, but: > It's O.K. I don't think many people are used to the fortran-order stuff. So, I doubt it's obvious. > For example, here is 0,1,2,3 as int32 > > str = '\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00' > > What

Re: [Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Travis Oliphant
Travis Oliphant wrote: > However, you can use the ndarray creation function itself to do what you > want: > > a = ndarray(shape=(2,2), dtype=int32, buffer=str, order='F') > > This will use the memory of the string as the new array memory. > Incidentally, the new array will be read-only. But, y

Re: [Numpy-discussion] trivial question: how to compare dtype - but ignoring byteorder ?

2006-08-14 Thread Sebastian Haase
On Monday 24 July 2006 12:36, Travis Oliphant wrote: > Sebastian Haase wrote: > > Hi, > > if I have a numpy array 'a' > > and say: > > a.dtype == numpy.float32 > > > > Is the result independent of a's byteorder ? > > (That's what I would expect ! Just checking !) > > I think I misread the question

Re: [Numpy-discussion] trivial question: how to compare dtype - but ignoring byteorder ?

2006-08-14 Thread Travis Oliphant
> Hi, > I just realized that this question did actually not get sorted out. > Now I'm just about to convert my code to compare > arr.dtype.type to the (default scalar!) dtype numpy.uint8 > like this: > if self.img.dtype.type == N.uint8: > self.hist_min, self.hist_max = 0, 1<<8 > elif self.img.dt

[Numpy-discussion] Regarding Matrices

2006-08-14 Thread Satya Upadhya
Dear All, Just a few queries regarding matrices. On my python shell i typed:   >>> from Numeric import *>>> from LinearAlgebra import *>>> A = [1,2,3,4,5,6,7,8,9]>>> B = reshape(A,(3,3))>>> Barray([[1, 2, 3],   [4, 5, 6],   [7, 8, 9]])>>> X = identity(3)>>> Xarray([[1, 0, 0],   [0, 1

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Sven Schreiber
Hi, Satya Upadhya schrieb: from Numeric import * Well this list is about the numpy package, but anyway... > the power function is giving a resultant matrix in which each element of > matrix B is raised to the power of 0 so as to make it 1. But, taken as a > whole i.e. matrix B to the power

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Nils Wagner
On Mon, 14 Aug 2006 21:58:50 +0200 Sven Schreiber <[EMAIL PROTECTED]> wrote: > Hi, > > Satya Upadhya schrieb: > > from Numeric import * > > Well this list is about the numpy package, but anyway... > >> the power function is giving a resultant matrix in which >>each element of >> matrix B

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Torgil Svensson
>>> import numpy >>> numpy.__version__ '1.0b1' >>> from numpy import * >>> A = [1,2,3,4,5,6,7,8,9] >>> B = asmatrix(reshape(A,(3,3))) >>> B matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> B**0 matrix([[ 1., 0., 0.], [ 0., 1., 0.], [ 0., 0., 1.]]) >>> power(B,0) m

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Travis Oliphant
Torgil Svensson wrote: import numpy numpy.__version__ > '1.0b1' > from numpy import * A = [1,2,3,4,5,6,7,8,9] B = asmatrix(reshape(A,(3,3))) B > matrix([[1, 2, 3], > [4, 5, 6], > [7, 8, 9]]) > B**0 >

[Numpy-discussion] ctypes and ndpointer

2006-08-14 Thread Albert Strasheim
Hello all Just a quick note on the ndpointer function that Travis recently added to NumPy (thanks Travis!). When wrapping functions with ctypes, one can specify the argument types of the function. ctypes then checks that the parameters are valid before invoking the C function. This is described

Re: [Numpy-discussion] ctypes and ndpointer

2006-08-14 Thread Travis Oliphant
Albert Strasheim wrote: > P.S. Sidebar: do we want these ctypes functions in the top-level namespace? > Maybe not. Also, I'm starting to wonder whether ctypes_load_library deserves > to exist or whether we should hear from the ctypes guys if there is a better > way to accomplish what it does (which

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Christopher Barker
Torgil Svensson wrote: > Shouldn't power() and the ** operator return the same result for matrixes? no, but the built-in pow() should -- does it? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice

Re: [Numpy-discussion] Segmentation Fault with Numeric 24.2 on Mac OS X 10.4 Tiger (8.7.0)

2006-08-14 Thread Christopher Barker
Daran L. Rife wrote: > I tried your suggestion of installing and running the pre-built > packages at . I am > sorry to report that the pre-built MacPython and Numeric 24.2 > package did not work. I get the same "Segmentation Fault" that > I got when I bu

Re: [Numpy-discussion] Segmentation Fault with Numeric 24.2 on Mac OS X 10.4 Tiger (8.7.0)

2006-08-14 Thread Daran Rife
Hi Chris, > Darn. My few simple tests all work. If you can figure out which > functions are failing, and make a small sample that fails, post it here > and to the python-mac list. There are some smart folks there that might > be able to help. I will try to do so, but like you, I think my time

[Numpy-discussion] How to share memory when bArr is smaller-sized than aArr

2006-08-14 Thread Sebastian Haase
Hi, in numarray I could do this >>> import numarray as na >>> a = na.arange(10) >>> b = na.array(a._data, type=na.int32, shape=8) b would use the beginning part of a. This is actually important for inplace FFT (where in real-to-complex-fft the input has 2 "columns" more memory than the output)

Re: [Numpy-discussion] How to share memory when bArr is smaller-sized than aArr

2006-08-14 Thread Travis Oliphant
Sebastian Haase wrote: > Hi, > in numarray I could do this > import numarray as na a = na.arange(10) b = na.array(a._data, type=na.int32, shape=8) > > b would use the beginning part of a. > > This is actually important for inplace FFT (where in real-to-complex-fft th

[Numpy-discussion] please comment on scalar types

2006-08-14 Thread Sebastian Haase
Hi! I have a record array with a field 'mode' Mode is a small integer that I use to choose a "PixelType" So I did: >>> print PixelTypes[ mode ] TypeError: tuple indices must be integers >>> pdb.pm() > /home/haase/PrLinN64/Priithon/Mrc.py(813)MrcMode2numType() -> return PixelTypes[ mode ] (Pdb) p mo

Re: [Numpy-discussion] please comment on scalar types

2006-08-14 Thread Travis Oliphant
Sebastian Haase wrote: > Hi! > I have a record array with a field 'mode' > Mode is a small integer that I use to choose a "PixelType" > So I did: > print PixelTypes[ mode ] > TypeError: tuple indices must be integers > pdb.pm() >> /home/haase/PrLinN64/Pri

Re: [Numpy-discussion] please comment on scalar types

2006-08-14 Thread Sebastian Haase
Travis Oliphant wrote: > Sebastian Haase wrote: >> Hi! >> I have a record array with a field 'mode' >> Mode is a small integer that I use to choose a "PixelType" >> So I did: >> > print PixelTypes[ mode ] > >> TypeError: tuple indices must be integers >> > pdb.pm() >

Re: [Numpy-discussion] please comment on scalar types

2006-08-14 Thread Travis Oliphant
Sebastian Haase wrote: >Travis Oliphant wrote: > > >And that automatically implies that there a 32bit-int cannot be used in >place of a "normal python integer" !? >I could see wanting to use int16 or event uint8 as a tuple index. >Logically a small type would be save to use in place of a bigge

Re: [Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Fernando Perez
On 8/14/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Travis Oliphant wrote: > > However, you can use the ndarray creation function itself to do what you > > want: > > > > a = ndarray(shape=(2,2), dtype=int32, buffer=str, order='F') > > > > This will use the memory of the string as the new array

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Andrew Straw
Sven Schreiber wrote: > Hi, > > Satya Upadhya schrieb: > > > from Numeric import * > > > Well this list is about the numpy package, but anyway... > This list is for numpy, numarray, and Numeric. There's just a lot more numpy talk going on these days, but "numpy-discussion"

Re: [Numpy-discussion] Creating and reshaping fortran order arrays

2006-08-14 Thread Travis Oliphant
Fernando Perez wrote: > Sweet! We now finally have mutable strings for Python: > > In [2]: astr = > '\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00' > > In [4]: a = N.ndarray(shape=(2,2), dtype=N.int32, buffer=astr, order='F') > > In [5]: astr > Out[5]: '\x00\x00\x00\x00\x01\x00\

[Numpy-discussion] Numpy 1.0b2 crash

2006-08-14 Thread Pauli Virtanen
Hi all, The following code causes a segmentation fault in Numpy 1.0b2 and 1.0b1. import numpy as N v = N.array([1,2,3,4,5,6,7,8,9,10]) N.lexsort(v) Stack trace === $ gdb --args python crash.py GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, cover