Re: [Numpy-discussion] tostring() for array rows

2009-10-09 Thread josef . pktd
On Wed, Oct 7, 2009 at 1:20 PM, Christopher Barker wrote: > josef.p...@gmail.com wrote: > >> I wanted to avoid the python loop and thought creating the view will be >> faster >> with large arrays. But for this I need to know the memory length of a >> row of arbitrary types for the conversion to s

Re: [Numpy-discussion] tostring() for array rows

2009-10-07 Thread Christopher Barker
josef.p...@gmail.com wrote: > I wanted to avoid the python loop and thought creating the view will be faster > with large arrays. But for this I need to know the memory length of a > row of arbitrary types for the conversion to strings, ndarray.itemsize might do it. -Chris -- Christopher B

Re: [Numpy-discussion] tostring() for array rows

2009-10-06 Thread josef . pktd
On Tue, Oct 6, 2009 at 4:39 PM, Christopher Barker wrote: > josef.p...@gmail.com wrote: >> If I have a structured or a regular array, is the use of strides in >> the following always correct for the length of the row memory? >> >> I would like to do tostring() but on each row, by creating a string

Re: [Numpy-discussion] tostring() for array rows

2009-10-06 Thread Christopher Barker
josef.p...@gmail.com wrote: > If I have a structured or a regular array, is the use of strides in > the following always correct for the length of the row memory? > > I would like to do tostring() but on each row, by creating a string > view of the memory in a 1d array. Maybe I'm missing what you

[Numpy-discussion] tostring() for array rows

2009-10-06 Thread josef . pktd
If I have a structured or a regular array, is the use of strides in the following always correct for the length of the row memory? I would like to do tostring() but on each row, by creating a string view of the memory in a 1d array. Thanks, Josef >>> tmp = np.random.randn(4,3) >>> tmp.ravel().