Re: [Numpy-discussion] ANN: line_profiler 1.0b2 released

2009-07-19 Thread Nicolas Pinto
Thanks a lot Robert for this very useful tool! I was wondering if there is a way to make it work with Cython code (see below) ? Sincerely, Nicolas fib.pyx: @profile def fib(n): """Print the Fibonacci series up to n.""" a, b = 0, 1 while b < n: a, b = b, a + b test.py: imp

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2009-07-19 Thread Nicolas Pinto
Jonathan, What does "ldd /home/jtaylor/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so" say ? You need to make sure that it's using the libraries in /usr/local/lib. You can remove the ones in /usr/lib or "export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH". Hope it helps. Best, N

Re: [Numpy-discussion] list dtype?

2009-07-19 Thread David Goldsmith
99 times out of 100, the way to do things in Numpy (as in Python) is simpler than what you thought - that's why we love 'em. ;-) DG --- On Sun, 7/19/09, Mark Wendell wrote: > From: Mark Wendell > Subject: Re: [Numpy-discussion] list dtype? > To: "Discussion of Numerical Python" > Date: Sund

Re: [Numpy-discussion] list dtype?

2009-07-19 Thread Mark Wendell
Excellent! I guess I was over-thinking it. Many thanks. Mark On Sun, Jul 19, 2009 at 4:50 PM, David Goldsmith wrote: > > Robert'll correct me if I'm wrong, but I think what he meant is that all you > have to do is: > > array_of_lists = numpy.empty(, dtype=object) > > and you'll be able to fill a

Re: [Numpy-discussion] list dtype?

2009-07-19 Thread David Goldsmith
Robert'll correct me if I'm wrong, but I think what he meant is that all you have to do is: array_of_lists = numpy.empty(, dtype=object) and you'll be able to fill array_of_lists with whatever you want: >>> aol = np.empty((2,2),dtype=object) >>> aol[:,:] = [[[1, 2, 3], ['a','b','c']], [[(), ()

Re: [Numpy-discussion] list dtype?

2009-07-19 Thread Mark Wendell
Sorry for being a newbie about it, but could you provide an example? I was able to do this: d = np.dtype( {'names':['mylist'], 'formats':[np.object]}) but I'm not sure if that's the correct way to produce a python list-type dtype. Further, how do I then define a new array with that as a dtype?

Re: [Numpy-discussion] list dtype?

2009-07-19 Thread Robert Kern
On Sun, Jul 19, 2009 at 11:22, Mark Wendell wrote: > Is it possible to create a dtype that is a list of arbitrary length? Use the object dtype. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret i

[Numpy-discussion] list dtype?

2009-07-19 Thread Mark Wendell
Is it possible to create a dtype that is a list of arbitrary length? More specifically, let's say I have a custom dtype like this: d = dtype( {'names':['index','xcoord','ycoord','weight'], 'formats': [ uint16, uint16, uint16, float ] } ) Now I'd like to create a 2D array where each entry is a LIS

Re: [Numpy-discussion] [Jepp-users] win64 numpy hangs during tests using embedded interpreter

2009-07-19 Thread Jon Wright
Ah, bugger, found the answer and it is bad news, from http://docs.python.org/c-api/init.html "Note that the PyGILState_*() functions assume there is only one global interpreter (created automatically by Py_Initialize() ). Python still suppo