Re: [Numpy-discussion] Float16 and PEP 3118

2010-12-03 Thread Pauli Virtanen
Fri, 03 Dec 2010 09:23:15 -0800, Mark Wiebe wrote: [clip] >> - refuse to export buffers containing half floats > > I think this is the better option, code that needs to do this can create > an int16 view for the time being. That's also easier to implement -- no changes are needed :) Pauli

Re: [Numpy-discussion] Float16 and PEP 3118

2010-12-03 Thread Mark Wiebe
On Thu, Dec 2, 2010 at 10:16 AM, Pauli Virtanen wrote: > Before introducing a PEP 3118 type code for half floats in the PEP, one > would need to argue the Python people to add it to the struct module. > > Before that, the choices probably are: > > - refuse to export buffers containing half floats

Re: [Numpy-discussion] itertools.combinations to numpy

2010-12-03 Thread Mario Moura
Hi Mr. Weckesser Thanks a lot! Works fine! Regards Mario 2010/12/3 Warren Weckesser : > > > On Fri, Dec 3, 2010 at 6:31 AM, Mario Moura wrote: >> >> Hi Folks >> >> I have this situation >> >> >>> from timeit import Timer >> >>> reps = 5 >> >>> >> >>> t = Timer('itertools.combinations(range(1,

Re: [Numpy-discussion] [PATCH] gfortran under macports

2010-12-03 Thread Charles R Harris
Hi Fabian, On Fri, Dec 3, 2010 at 8:24 AM, Fabian Pedregosa wrote: > Hi all. > > Macports installs gfortran as part of the gcc package, but names it > gfortran-mp-$version, without providing a symbolic link to a default > gcfortran executable, and thus numpy.distutils is unable to find the > righ

Re: [Numpy-discussion] numpy.test() Program received signal SIGABRT, Aborted.

2010-12-03 Thread Charles R Harris
On Fri, Dec 3, 2010 at 12:56 AM, Nils Wagner wrote: > On Fri, 03 Dec 2010 08:47:32 +0100 > "Nils Wagner" wrote: > > On Fri, 3 Dec 2010 00:42:16 -0700 > > Charles R Harris wrote: > >> On Fri, Dec 3, 2010 at 12:29 AM, Nils Wagner > >> wrote: > >> > >>> Hi all, > >>> > >>> I have installed the l

[Numpy-discussion] [PATCH] gfortran under macports

2010-12-03 Thread Fabian Pedregosa
Hi all. Macports installs gfortran as part of the gcc package, but names it gfortran-mp-$version, without providing a symbolic link to a default gcfortran executable, and thus numpy.distutils is unable to find the right executable. The attached patch very simple, it just extends possible_executab

Re: [Numpy-discussion] itertools.combinations to numpy

2010-12-03 Thread Warren Weckesser
On Fri, Dec 3, 2010 at 6:31 AM, Mario Moura wrote: > Hi Folks > > I have this situation > > >>> from timeit import Timer > >>> reps = 5 > >>> > >>> t = Timer('itertools.combinations(range(1,10),3)', 'import itertools') > >>> print sum(t.repeat(repeat=reps, number=1)) / reps > 1.59740447998e-05 >

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-03 Thread Sturla Molden
> It's hard to write Cython code that can handle all dtypes and > arbitrary number of dimensions. The former is typically dealt with > using templates, but what do people do about the latter? There are number of ways to do it. NumPy's C API has an iterator that returns an axis on demand. Mine just

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-03 Thread Sturla Molden
> if ndim == 1: > stride = a.strides[0] // itemsize # convert stride bytes --> items Oh, did I really do this in selectmodule.pyx? :( That is clearly an error. I don't have time to fix it now. Sturla ___ NumPy-Discussion mailing list Num

[Numpy-discussion] itertools.combinations to numpy

2010-12-03 Thread Mario Moura
Hi Folks I have this situation >>> from timeit import Timer >>> reps = 5 >>> >>> t = Timer('itertools.combinations(range(1,10),3)', 'import itertools') >>> print sum(t.repeat(repeat=reps, number=1)) / reps 1.59740447998e-05 >>> t = Timer('itertools.combinations(range(1,100),3)', 'import itertools

Re: [Numpy-discussion] numpy.r_[True, False] is not a boolean array

2010-12-03 Thread josef . pktd
On Fri, Dec 3, 2010 at 6:29 AM, oc-spam66 wrote: > Hello, > > I observe the following behavior: > > numpy.r_[True, False]   -> array([1, 0], dtype=int8) > numpy.r_[True]          -> array([ True], dtype=bool) and >>> np.r_[[True], [False]] array([ True, False], dtype=bool) >>> np.r_[[True, Fals

[Numpy-discussion] numpy.r_[True, False] is not a boolean array

2010-12-03 Thread oc-spam66
Hello, I observe the following behavior: numpy.r_[True, False] -> array([1, 0], dtype=int8) numpy.r_[True] -> array([ True], dtype=bool) I would expect the first line to give a boolean array: array([ True, False], dtype=bool) Is it normal? Is it a bug? -- O.C. numpy.__version__ = '