Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-25 Thread Travis Oliphant
I will just let Jay know that he should coordinate with you.It would be helpful for him to have someone to collaborate with on this. I'm looking forward to seeing your code. Definitely don't hold back on our account. We will adapt to whatever you can offer. Best regards, -Travis On

Re: [Numpy-discussion] Creating a bool array with Cython

2012-02-25 Thread Dag Sverre Seljebotn
On 02/25/2012 03:26 PM, Keith Goodman wrote: > Is this a reasonable (and fast) way to create a bool array in cython? > > def makebool(): > cdef: > int n = 2 > np.npy_intp *dims = [n] > np.ndarray[np.uint8_t, ndim=1] a > a = PyArray_EMPTY

[Numpy-discussion] Creating a bool array with Cython

2012-02-25 Thread Keith Goodman
Is this a reasonable (and fast) way to create a bool array in cython? def makebool(): cdef: int n = 2 np.npy_intp *dims = [n] np.ndarray[np.uint8_t, ndim=1] a a = PyArray_EMPTY(1, dims, NPY_UINT8, 0) a[0] = 1 a[1] = 0

Re: [Numpy-discussion] distributing pre-compiled f2py extensions on OSX

2012-02-25 Thread Ralf Gommers
On Sat, Feb 25, 2012 at 9:29 PM, Mark Bakker wrote: > Thanks for the reply, Ralf. > Can you point me a bit in the right direction. > Scipy is pretty big. > All Fortran sources in Scipy are wrapped with f2py, and can be compiled with gfortran the way you want. As a simple example, have a look at

Re: [Numpy-discussion] bincount([], minlength=2) should work right?

2012-02-25 Thread James Bergstra
On Sat, Feb 25, 2012 at 5:13 PM, Alan G Isaac wrote: > On 2/25/2012 4:44 PM, James Bergstra wrote: >> bincount([]) makes no sense, > > I disagree: > http://permalink.gmane.org/gmane.comp.python.numeric.general/42041 > gmane is down to me at the moment, but if this argues that the answer should be

Re: [Numpy-discussion] bincount([], minlength=2) should work right?

2012-02-25 Thread Benjamin Root
On Saturday, February 25, 2012, Alan G Isaac wrote: > On 2/25/2012 4:44 PM, James Bergstra wrote: > > bincount([]) makes no sense, > > I disagree: > http://permalink.gmane.org/gmane.comp.python.numeric.general/42041 > > > > but if a minlength argument is provided, > > then the routine should succe

Re: [Numpy-discussion] bincount([], minlength=2) should work right?

2012-02-25 Thread Skipper Seabold
On Sat, Feb 25, 2012 at 5:13 PM, Alan G Isaac wrote: > On 2/25/2012 4:44 PM, James Bergstra wrote: >> bincount([]) makes no sense, > > I disagree: > http://permalink.gmane.org/gmane.comp.python.numeric.general/42041 > > >> but if a minlength argument is provided, >> then the routine should succeed

Re: [Numpy-discussion] bincount([], minlength=2) should work right?

2012-02-25 Thread Alan G Isaac
On 2/25/2012 4:44 PM, James Bergstra wrote: > bincount([]) makes no sense, I disagree: http://permalink.gmane.org/gmane.comp.python.numeric.general/42041 > but if a minlength argument is provided, > then the routine should succeed. Definitely! Alan Isaac ___

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-25 Thread Erin Sheldon
Excerpts from Wes McKinney's message of Sat Feb 25 15:49:37 -0500 2012: > That may work-- I haven't taken a look at the code but it is probably > a good starting point. We could create a new repo on the pydata GitHub > org (http://github.com/pydata) and use that as our point of > collaboration. I w

[Numpy-discussion] bincount([], minlength=2) should work right?

2012-02-25 Thread James Bergstra
bincount([]) makes no sense, but if a minlength argument is provided, then the routine should succeed. It fails in 1.6.1, has it been fixed in master? - James -- http://www-etud.iro.umontreal.ca/~bergstrj ___ NumPy-Discussion mailing list NumPy-Discussi

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-25 Thread Wes McKinney
On Fri, Feb 24, 2012 at 9:07 AM, Erin Sheldon wrote: > Excerpts from Travis Oliphant's message of Thu Feb 23 15:08:52 -0500 2012: >> This is actually on my short-list as well --- it just didn't make it to the >> list. >> >> In fact, we have someone starting work on it this week.  It is his >> fir

Re: [Numpy-discussion] numpy uint16 array to unicode string

2012-02-25 Thread Janwillem
Thanks, works, should have found that myself. On 25-02-2012 20:56, Robert Kern wrote: > On Sat, Feb 25, 2012 at 19:50, Janwillem wrote: >> I have a buffer as a numpy array of uint16. Chunks of this buffer are >> unicode characters. How do I get these chunks, say data[start:end], in a >> string? >

Re: [Numpy-discussion] distributing pre-compiled f2py extensions on OSX

2012-02-25 Thread Mark Bakker
; 2. Should extensions compiled on Snowleopard work on Lion? > > > > Yes. > > Ralf > -- next part -- > An HTML attachment was scrubbed... > URL: > http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120225/9fa76d70/attachment-0001

Re: [Numpy-discussion] numpy uint16 array to unicode string

2012-02-25 Thread Robert Kern
On Sat, Feb 25, 2012 at 19:50, Janwillem wrote: > I have a buffer as a numpy array of uint16. Chunks of this buffer are > unicode characters. How do I get these chunks, say data[start:end], in a > string? data[sart:end].tostring().decode('UTF-16LE') or 'UTF-16BE' if they are big-endian. > Other

[Numpy-discussion] numpy uint16 array to unicode string

2012-02-25 Thread Janwillem
I have a buffer as a numpy array of uint16. Chunks of this buffer are unicode characters. How do I get these chunks, say data[start:end], in a string? Other chunks are 32bit integers how do I get these chunks into a numpy array of int32? Many thanks, Janwillem ___

Re: [Numpy-discussion] Problem Building Numpy with Python 2.7.1 and OS X 10.7.3

2012-02-25 Thread Ralf Gommers
On Thu, Feb 23, 2012 at 11:28 PM, Patrick Armstrong wrote: > Hi there, > > I'm having a problem building NumPy on Python 2.7.1 and OS X 10.7.3. Here > is my build log: > > https://gist.github.com/1895377 > > Does anyone have any idea what might be happening? I get a very similar > error when compi

Re: [Numpy-discussion] distributing pre-compiled f2py extensions on OSX

2012-02-25 Thread Ralf Gommers
On Fri, Feb 24, 2012 at 3:39 PM, Mark Bakker wrote: > Two short questions: > > 1. When I distribute pre-compiled f2py extensions for OSX, it seems that > the users need gfortran installed, else it cannot find libgfortran.3.dylib. > Is there a way to link that file with the extension? > You can l