Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Albert Strasheim
Hello all > > In this case, I think one wants strides[0] (the row stride) to return > 40. > > > > Why do you think that? > > All sliced arrays keep the same strides information as their > "parents". This is the essence of a "view". The striding is exactly > the same as before (the data hasn't

Re: [Numpy-discussion] A C++ library and the new array interface: the best approach?

2006-07-04 Thread Albert Strasheim
Hello all On Mon, 03 Jul 2006, Travis Oliphant wrote: > Fernando Perez wrote: > > Hi all, > > > > but my lack of familiarity with all the details of new type creation got me > > a > > bit lost. I'm sure the information I need is all there, but right now I > > don't > > really see the forest

[Numpy-discussion] tentative numpy tutorial

2006-07-04 Thread Pau Gargallo
hi all, motivated by the lack of free documentation for NumPy, with some friends, we started writing a tutorial, that we would like to see in scipy.org. After some time, the project have started to loose its initial impetus. Now, we put the current unfinished version in http://www.scipy.org/Tenta

[Numpy-discussion] Error building numpy from svn, 2nd attempt

2006-07-04 Thread John Carter
Hi, As is the way posting to a news group stirs the brain cell into activity and the problem is solved. or rather shifted. I've downloaded the candidate version of mingw32 and using that to build numpy/scipy works, or rather it builds the extensions for Python 2.3 I believe that there are stil

Re: [Numpy-discussion] unique() should return a sorted array

2006-07-04 Thread Robert Cimrman
David Huard wrote: > Here is a quick benchmark between numpy's unique, unique1d and sasha's > unique: > > x = rand(10)*100 > x = x.astype('i') > > %timeit unique(x) > 10 loops, best of 3: 525 ms per loop > > %timeit unique_sasha(x) > 100 loops, best of 3: 10.7 ms per loop > > timeit unique1

Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Thomas Heller
Travis Oliphant schrieb: > I've been playing a bit with ctypes and realized that with a little > help, it could be made much easier to interface with NumPy arrays. > Thus, I added a ctypes attribute to the NumPy array. If ctypes is > installed, this attribute returns a "conversion" object othe

Re: [Numpy-discussion] A C++ library and the new array interface: the best approach?

2006-07-04 Thread Simon Anders
Hi Fernando, Fernando Perez schrieb: [...] > So I'd like to know if SWIG is really the best way out in this particular > case > (and any advice on taking advantage of the array interface via SWIG would be > appreciated), or if ctypes or pyrex could be used here. I'm quite happy > using > pyr

Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Thomas Heller
Thomas Heller schrieb: > I've also played a little, and I think one important limitation in ctypes > is that items in the argtypes list have to be ctypes types. Thi swas misleading: I mean that this limitation should probably be removed, because it prevents a lot of things one could do. Thomas

[Numpy-discussion] KeyError with float96 in linalg.py: polyfit

2006-07-04 Thread Jan-Matthias Braun
Hi all, I'm testing some computations with float96 at the moment and right now I have problems with polyfit raising a KeyError for the keycode 'g', which is floatxx with xx>64. I am getting a KeyError using polyfit on some float96 values. The used Routines seem to know nothing about this type

Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Albert Strasheim
Hey Thomas Thomas Heller wrote: > Thomas Heller schrieb: > > I've also played a little, and I think one important limitation in > ctypes > > is that items in the argtypes list have to be ctypes types. > > Thi swas misleading: I mean that this limitation should probably be > removed, because it p

Re: [Numpy-discussion] A C++ library and the new array interface: the best approach?

2006-07-04 Thread Simon Burton
On Mon, 03 Jul 2006 16:41:11 -0600 Fernando Perez <[EMAIL PROTECTED]> wrote: > > So I'd like to know if SWIG is really the best way out in this particular > case > (and any advice on taking advantage of the array interface via SWIG would be > appreciated), or if ctypes or pyrex could be used h

Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Thomas Heller
Albert Strasheim schrieb: > Hey Thomas > > Thomas Heller wrote: >> Thomas Heller schrieb: >> > I've also played a little, and I think one important limitation in >> ctypes >> > is that items in the argtypes list have to be ctypes types. >> >> Thi swas misleading: I mean that this limitation shou

Re: [Numpy-discussion] iterate along a ray: linear algebra?

2006-07-04 Thread stephen emslie
I've found some matlab code that seems to do the same sort of thing. Interestingly enough it just uses trigonomotry to do find the x,y positions in the matrix that correspond to the ray at a particular angle. I had origionally discarded this idea because I thought there must be a more efficient way

Re: [Numpy-discussion] Ctypes support in NumPy

2006-07-04 Thread Albert Strasheim
Hello all On Tue, 04 Jul 2006, Thomas Heller wrote: > Albert Strasheim schrieb: > > Hey Thomas > > > > Thomas Heller wrote: > >> Thomas Heller schrieb: > >> > I've also played a little, and I think one important limitation in > >> ctypes > >> > is that items in the argtypes list have to be ctype

[Numpy-discussion] Speed degression?

2006-07-04 Thread Steffen Loeck
Hi all, i made some speed tests using the sin-function and the %-operation to compare Numeric, numpy 0.9.8 and numpy 0.9.9.2732. As result the latest numpy version seems to be very slow in comparison to the two other candidates. Results (in usec per loop):

Re: [Numpy-discussion] Error building numpy from svn, 2nd attempt

2006-07-04 Thread David Huard
Hi John, Here is a patch to fix the first error in test_twodim_base.py.I'm sorry I can't help you with the rest. David2006/7/4, John Carter < [EMAIL PROTECTED]>:Hi,As is the way posting to a news group stirs the brain cell into activity and the problem is solved. or rather shifted.I've downloaded t

[Numpy-discussion] Why is my array not contiguous?

2006-07-04 Thread Jens Jørgen Mortensen
Hi! With numpy-0.9.9.2726, I do this: >>> x = arange(4) >>> y = x[newaxis, :] I would expect both arrays to be contiguous: >>> x.flags.contiguous, y.flags.contiguous (True, False) Shouldn't y be contiguous? Maybe it's because of the strange strides: >>> y.strides (0, 4) >>> y.strides =

[Numpy-discussion] Dot as a method

2006-07-04 Thread Bart Vandereycken
Hi all, reading the thread "Ransom proposals" I was wondering why there isn't a ndarray.dot() method? There is already a scipy.sparse.dot() so this would fit nicely in the whole idea of polymorphism. Bart Using Tomcat but need to do more? Need to support web services, security? Get stuff don

Re: [Numpy-discussion] KeyError with float96 in linalg.py: polyfit

2006-07-04 Thread David M. Cooke
On Tue, 4 Jul 2006 12:10:18 +0200 Jan-Matthias Braun <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm testing some computations with float96 at the moment and right now I > have problems with polyfit raising a KeyError for the keycode 'g', which is > floatxx with xx>64. Use longdouble instead of fl

[Numpy-discussion] arguments for stats.chi2

2006-07-04 Thread JJ
Hello. I have a very simple question. I would like to generate a number of random variables from the chi2 distribution. If I wanted these for the normal distribution, the code could be stats.norm.rvs(size=5,loc=100,scale=1). But stats.chi2.rvs(size=5,df=10,loc=0,scale=1) or stats.chi2.rvs(df=10

Re: [Numpy-discussion] MA bug or feature?

2006-07-04 Thread Paul Dubois
Some things to note:The mask is copy-on-write. Don't mess with that. You can't just poke values into an existing mask, it may be shared with other arrays.I do not agree that there is any 'inconsistency'. It may be someone's concept of the class that if there is a mask then at least one value is on,

[Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-04 Thread Bill Baxter
Just wanted to make one last effort get a .T attribute for arrays, so that you can flip axes with a simple "a.T" instead of "a.transpose()", as with numpy matrix objects.If I recall, the main objection raised before was that there are lots of ways to transpose n-dimensional data. Fine, but the fact

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-04 Thread Bill Baxter
Slight correction.{*} except that negative axes for swapaxes doesn't seem work currently, so instead it would need to be something like:       a.transpose( a.shape[:-2] + (a.shape[-1],a.shape[-2]) )   with a check for "if ndim > 1", of course.Apparently a.swapaxes(-2,-1) does work, and it does exac

[Numpy-discussion] 你要了解的,就在此有介绍!

2006-07-04 Thread 中国金属工业网
numpy-discussion:您好!      你可以查阅www.cmpi.cn,快去看!   致 礼!    中国金属工业网    [EMAIL PROTECTED]    2006-07-05 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your jo

[Numpy-discussion] Simple 3D drawing options?

2006-07-04 Thread Bill Baxter
I tried to get MayaVi and VTK working under Win32/MSVC.Net a while back failed miserably.Is there some simple, out-of-the-box, precompiled, no-brains-required solution for creating 3D plots?  Preferably one that doesn't require compiling anything. --Bill Using Tomcat but need to do more? Need to su