Re: [Numpy-discussion] ValueError: Unknown format code 'g' for object of type 'str'

2011-03-26 Thread Mark Wiebe
It turns out that Python 2.6 complex doesn't implement __format__, and that results in the problem. http://web.archiveorange.com/archive/v/jA6s92Ni29ENZpi4rpz5 I've disabled the complex formatting tests for 2.6 in commit 7d436cc8994f9efbc512.

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
Hi Paul, having had a look at the other tickets you dug up, > My opinions are my own, and in detail, they are: > 1752: >I attach a possible patch. FWIW, I agree with the request. The > patch is written to be compatible with the fix in ticket #1562, but > I did not test that yet. Tested,

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Charles R Harris
On Sat, Mar 26, 2011 at 8:53 AM, Paul Anton Letnes < paul.anton.let...@gmail.com> wrote: > Hi Derek! > > On 26. mars 2011, at 15.48, Derek Homeier wrote: > > > Hi again, > > > > On 26 Mar 2011, at 15:20, Derek Homeier wrote: > >>> > >>> 1562: > >>> I attach a possible patch. This could also be th

Re: [Numpy-discussion] Array views

2011-03-26 Thread srean
On Sat, Mar 26, 2011 at 3:16 PM, srean wrote: > > Ah! very nice. I did not know that numpy-1.6.1 supports in place 'dot', > In place is perhaps not the right word, I meant "in a specified location" ___ NumPy-Discussion mailing list NumPy-Discussion@sci

Re: [Numpy-discussion] Array views

2011-03-26 Thread srean
Ah! very nice. I did not know that numpy-1.6.1 supports in place 'dot', and neither the fact that you could access the underlying BLAS functions like so. This is pretty neat. Thanks. Now I at least have an idea how the sparse version might work. If I get time I will probably give numpy-1.6.1 a sho

Re: [Numpy-discussion] Array views

2011-03-26 Thread Pauli Virtanen
On Sat, 26 Mar 2011 19:13:43 +, Pauli Virtanen wrote: [clip] > If you want to have control over temporaries, you can make use of the > out= argument of ufuncs (`numpy.dot` will gain it in 1.6.1 --- you can > call LAPACK routines from scipy.lib in the meantime, if your data is in > Fortran order

Re: [Numpy-discussion] Array views

2011-03-26 Thread Pauli Virtanen
On Sat, 26 Mar 2011 12:32:24 -0500, srean wrote: [clip] > Is there anyway apart from using ufuncs that I can make updater() write > the result directly in b and not create a new temporary column that is > then copied into b? Say for the matrix vector multiply example. I can > write the matrix vect

Re: [Numpy-discussion] Array views

2011-03-26 Thread srean
Hi Christopher, thanks for taking the time to reply at length. I do understand the concept of striding in general but was not familiar with the Numpy way of accessing that information. So thanks for pointing me to .flag and .stride. That said, BLAS/LAPACK do have apis that take the stride length

Re: [Numpy-discussion] Array views

2011-03-26 Thread Christopher Barker
On 3/26/11 10:12 AM, Pauli Virtanen wrote: > On Sat, 26 Mar 2011 13:10:42 -0400, Hugo Gagnon wrote: > [clip] >> a1 = b[:,0] >> a2 = b[:,1] >> ... >> >> and it works but that doesn't help me for my problem. Is there a way to >> reformulate the first code snippet above but with shallow copying? > > N

Re: [Numpy-discussion] Array views

2011-03-26 Thread Christopher Barker
On 3/26/11 10:32 AM, srean wrote: > I am also interested in this. In my application there is a large 2d > array, lets call it 'b' to keep the notation consistent in the thread. > b's columns need to be recomputed often. Ideally this re-computation > happens in a function. Lets call that function

Re: [Numpy-discussion] Array views

2011-03-26 Thread srean
Hi, I am also interested in this. In my application there is a large 2d array, lets call it 'b' to keep the notation consistent in the thread. b's columns need to be recomputed often. Ideally this re-computation happens in a function. Lets call that function updater(b, col_index): The simplest e

Re: [Numpy-discussion] Array views

2011-03-26 Thread Pauli Virtanen
On Sat, 26 Mar 2011 13:10:42 -0400, Hugo Gagnon wrote: [clip] > a1 = b[:,0] > a2 = b[:,1] > ... > > and it works but that doesn't help me for my problem. Is there a way to > reformulate the first code snippet above but with shallow copying? No. You need an 2-D array to "own" the data. The second

[Numpy-discussion] Array views

2011-03-26 Thread Hugo Gagnon
Hello, Say I have a few 1d arrays and one 2d array which columns I want to be the 1d arrays. I also want all the a's arrays to share the *same data* with the b array. If I call my 1d arrays a1, a2, etc. and my 2d array b, then b[:,0] = a1[:] b[:,1] = a2[:] ... won't work because apparently copyi

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Paul Anton Letnes
Hi Derek! On 26. mars 2011, at 15.48, Derek Homeier wrote: > Hi again, > > On 26 Mar 2011, at 15:20, Derek Homeier wrote: >>> >>> 1562: >>> I attach a possible patch. This could also be the default >>> behavior to my mind, since the function caller can simply call >>> numpy.squeeze if needed.

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
Hi again, On 26 Mar 2011, at 15:20, Derek Homeier wrote: >> >> 1562: >> I attach a possible patch. This could also be the default >> behavior to my mind, since the function caller can simply call >> numpy.squeeze if needed. Changing default behavior would probably >> break old code, > > Seems th

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
Hi, On 26 Mar 2011, at 14:36, Pauli Virtanen wrote: > > On Sat, 26 Mar 2011 13:11:46 +0100, Paul Anton Letnes wrote: > [clip] >> I hope you find this useful! Is there some way of submitting the >> patches >> for review in a more convenient fashion than e-mail? > > You can attach them on the trac

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Pauli Virtanen
Hi, Thanks! On Sat, 26 Mar 2011 13:11:46 +0100, Paul Anton Letnes wrote: [clip] > I hope you find this useful! Is there some way of submitting the patches > for review in a more convenient fashion than e-mail? You can attach them on the trac to each ticket. That way they'll be easy to find late

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Paul Anton Letnes
Hi! I have had a look at the list of numpy.loadtxt tickets. I have never contributed to numpy before, so I may be doing stupid things - don't be afraid to let me know! My opinions are my own, and in detail, they are: 1752: I attach a possible patch. FWIW, I agree with the request. The patch

[Numpy-discussion] ValueError: Unknown format code 'g' for object of type 'str'

2011-03-26 Thread Nils Wagner
>>> numpy.__version__ '2.0.0.dev-10db259' == ERROR: Test the str.format method with NumPy scalar types -- Traceback (most recent call last): File "/home/nwagn