[Numpy-discussion] bug in genfromtxt for python 3.2

2011-03-28 Thread josef . pktd
numpy/lib/test_io.pyonly uses StringIO in the test, no actual csv file If I give the filename than I get a TypeError: Can't convert 'bytes' object to str implicitly from the statsmodels mailing list example data = recfromtxt(open('./star98.csv', "U"), delimiter=",", skip_header=1, >>

Re: [Numpy-discussion] stable sort on a recarray ?

2011-03-28 Thread josef . pktd
On Mon, Mar 28, 2011 at 3:34 PM, wrote: > What is the recommended way to perform a stable sort on a recarray / > structured array ? > > In the following example, I want to sort on name, while retaining the > existing order in the case of equal values: > values = [('a', 1), ('a', 0), ('b', 2)] > d

Re: [Numpy-discussion] Array views

2011-03-28 Thread Pearu Peterson
On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden wrote: > Den 28.03.2011 19:12, skrev Pearu Peterson: > > > > FYI, f2py in numpy 1.6.x supports also assumed shape arrays. > > How did you do that? Chasm-interop, C bindings from F03, or marshalling > through explicit-shape? > The latter. Basically

Re: [Numpy-discussion] 1.6.0b1 half float buffer bug?

2011-03-28 Thread Mark Wiebe
On Mon, Mar 28, 2011 at 10:45 AM, Eli Stevens (Gmail) wrote: > On Fri, Mar 25, 2011 at 11:14 AM, Eli Stevens (Gmail) > wrote: > > On Fri, Mar 25, 2011 at 10:35 AM, Mark Wiebe wrote: > >> That said, I think starting a discussion with the Python core developers > >> about the float16 type is worth

Re: [Numpy-discussion] Array views

2011-03-28 Thread Sturla Molden
Den 28.03.2011 19:12, skrev Pearu Peterson: > > FYI, f2py in numpy 1.6.x supports also assumed shape arrays. How did you do that? Chasm-interop, C bindings from F03, or marshalling through explicit-shape? Can f2py pass strided memory from NumPy to Fortran? Sturla ___

[Numpy-discussion] stable sort on a recarray ?

2011-03-28 Thread butterw
What is the recommended way to perform a stable sort on a recarray / structured array ? In the following example, I want to sort on name, while retaining the existing order in the case of equal values: values = [('a', 1), ('a', 0), ('b', 2)] dtype = [('name', 'S10'), ('val', 'i4')] a = np.a

Re: [Numpy-discussion] 1.6.0b1 half float buffer bug?

2011-03-28 Thread Eli Stevens (Gmail)
On Fri, Mar 25, 2011 at 11:14 AM, Eli Stevens (Gmail) wrote: > On Fri, Mar 25, 2011 at 10:35 AM, Mark Wiebe wrote: >> That said, I think starting a discussion with the Python core developers >> about the float16 type is worthwhile. There might be interest in supporting >> the float16 type in the

Re: [Numpy-discussion] Array views

2011-03-28 Thread Pearu Peterson
On Mon, Mar 28, 2011 at 6:01 PM, Sturla Molden wrote > > > I'll try to clarify this: > > ** Most Fortran 77 compilers (and beyond) assume explicit-shape and > assumed-size arrays are contiguous blocks of memory. That is, arrays > declared like a(m,n) or a(m,*). They are usually passed as a pointer

Re: [Numpy-discussion] Problems building NumPy with GotoBLAS

2011-03-28 Thread Giuseppe Aprea
Dear Paul Anton, thanks a lot for your suggestion. I was also successful with [blas] libraries = blas library_dirs = $PREFIX/gotoblas2/lib [lapack] libraries = lapack library_dirs = $PREFIX/gotoblas2/lib but I had compile clapack as a shared library and place a symbolic link ln -s $PREFIX/gotobl

Re: [Numpy-discussion] Array views

2011-03-28 Thread Sturla Molden
Den 28.03.2011 14:28, skrev Dag Sverre Seljebotn: > > Sure, I realize that it is not standard. I'm mostly wondering whether > major Fortran compilers support working with strided memory in practice > (defined as you won't get out-of-memory-errors when passing around huge > strided array subset). O

Re: [Numpy-discussion] Array views

2011-03-28 Thread Sturla Molden
Den 28.03.2011 17:01, skrev Sturla Molden: > > ** Most Fortran compilers will make a temporary copy when passing a > non-contiguous array section to a subroutine expecting an explicit-shape > or assumed-shape array. Sorry, typo. The latter should be "assumed-size array". Sturla _

Re: [Numpy-discussion] Array views

2011-03-28 Thread Sturla Molden
Den 28.03.2011 14:28, skrev Dag Sverre Seljebotn: > > Sure, I realize that it is not standard. I'm mostly wondering whether > major Fortran compilers support working with strided memory in practice > (defined as you won't get out-of-memory-errors when passing around huge > strided array subset). I

Re: [Numpy-discussion] Array views

2011-03-28 Thread Dag Sverre Seljebotn
On 03/28/2011 12:55 PM, Sturla Molden wrote: > Den 28.03.2011 09:34, skrev Dag Sverre Seljebotn: >> What would we do exactly -- pass the entire underlying buffer to Fortran >> and then re-slice it Fortran side? > Pass a C pointer to the first element along with shape and strides, get > a Fortran po

Re: [Numpy-discussion] Array views

2011-03-28 Thread Sturla Molden
Den 28.03.2011 09:34, skrev Dag Sverre Seljebotn: > What would we do exactly -- pass the entire underlying buffer to Fortran > and then re-slice it Fortran side? Pass a C pointer to the first element along with shape and strides, get a Fortran pointer using c_f_pointer, then reslice the Fortran p

Re: [Numpy-discussion] Array views

2011-03-28 Thread Dag Sverre Seljebotn
On 03/27/2011 08:54 PM, Sturla Molden wrote: > Den 26.03.2011 19:31, skrev Christopher Barker: > >> To understand all this, you'll need to study up a bit on how numpy >> arrays lay out and access the memory that they use: they use a concept >> of "strided" memory. It's very powerful and flexible, b