Re: [Numpy-discussion] printing structured arrays

2010-03-10 Thread Bruce Schultz
On 10/03/10 10:09, Bruce Schultz wrote: > On Sat, Mar 6, 2010 at 8:35 AM, Gökhan Sever wrote: > >> On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz >> wrote: >> >>> Output is: >>> ### ndarray >>> [[ 1. 2. ] >>> [ 3. 4.1]] >>> ### structured array >>> [(1.0, 2.0) (3.0, 4.09

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Bruce Schultz
On Sat, Mar 6, 2010 at 8:35 AM, Gökhan Sever wrote: > > > On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz > wrote: >> >> Output is: >> ### ndarray >> [[ 1.   2. ] >>  [ 3.   4.1]] >> ### structured array >> [(1.0, 2.0) (3.0, 4.0996)] >> >> >> Thanks >> Bruce >> > > I still couldn't figu

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
>> Is this worth to go into the official docs? >> The page http://docs.scipy.org/doc/numpy/user/basics.rec.html is quite >> sparse... >> >> I still wonder why there is not a quick function for such a view / >> reshape conversion. > > > Thanks, the docs for working with arrays with structured dtyp

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
josef.p...@gmail.com schrieb: > On Mon, Mar 8, 2010 at 5:50 PM, Tim Michelsen > wrote: >> Hello, >> thanks to all who responded and have their input here. >> >> I added a little code snippet to show the view and reshape: >> >> http://www.scipy.org/Cookbook/Recarray >> >> What do you think? >> Is t

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
>> I still wonder why there is not a quick function for such a view / >> reshape conversion. > > Because it is difficult (impossible?) to do in the general case. .view() > really isn't that bad, in fact, it remarkably powerful and flexible! I would not drop .view() but rather add a convenience fu

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Chris Barker
Tim Michelsen wrote: > I still wonder why there is not a quick function for such a view / > reshape conversion. Because it is difficult (impossible?) to do in the general case. .view() really isn't that bad, in fact, it remarkably powerful and flexible! -Chris -- Christopher Barker, Ph.D. Oce

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread josef . pktd
On Mon, Mar 8, 2010 at 5:50 PM, Tim Michelsen wrote: > Hello, > thanks to all who responded and have their input here. > > I added a little code snippet to show the view and reshape: > > http://www.scipy.org/Cookbook/Recarray > > What do you think? > Is this worth to go into the official docs? > T

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Tim Michelsen
Hello, thanks to all who responded and have their input here. I added a little code snippet to show the view and reshape: http://www.scipy.org/Cookbook/Recarray What do you think? Is this worth to go into the official docs? The page http://docs.scipy.org/doc/numpy/user/basics.rec.html is quite s

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Pierre GM
On Mar 8, 2010, at 1:55 PM, Tim Michelsen wrote: > Hello, > I am also looking into the convertsion from strcutured arrays to ndarray. > >> I've just started playing with numpy and have noticed that when printing >> a structured array that the output is not nicely formatted. Is there a >> way to ma

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 2:24 PM, Skipper Seabold wrote: > On Mon, Mar 8, 2010 at 2:17 PM,   wrote: >> On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold wrote: >>> On Mon, Mar 8, 2010 at 2:01 PM,   wrote: On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen wrote: > Hello, > I am also loo

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Skipper Seabold
On Mon, Mar 8, 2010 at 2:17 PM, wrote: > On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold wrote: >> On Mon, Mar 8, 2010 at 2:01 PM,   wrote: >>> On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen >>> wrote: Hello, I am also looking into the convertsion from strcutured arrays to ndarray. >>>

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold wrote: > On Mon, Mar 8, 2010 at 2:01 PM,   wrote: >> On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen >> wrote: >>> Hello, >>> I am also looking into the convertsion from strcutured arrays to ndarray. >>> I've just started playing with numpy and h

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Skipper Seabold
On Mon, Mar 8, 2010 at 2:01 PM, wrote: > On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen > wrote: >> Hello, >> I am also looking into the convertsion from strcutured arrays to ndarray. >> >>> I've just started playing with numpy and have noticed that when printing >>> a structured array that the o

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen wrote: > Hello, > I am also looking into the convertsion from strcutured arrays to ndarray. > >> I've just started playing with numpy and have noticed that when printing >> a structured array that the output is not nicely formatted. Is there a >> way t

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Tim Michelsen
Hello, I am also looking into the convertsion from strcutured arrays to ndarray. > I've just started playing with numpy and have noticed that when printing > a structured array that the output is not nicely formatted. Is there a > way to make the formatting look the same as it does for an unstruct

Re: [Numpy-discussion] printing structured arrays

2010-03-05 Thread Gökhan Sever
On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz wrote: > Hi, > > I've just started playing with numpy and have noticed that when printing a > structured array that the output is not nicely formatted. Is there a way to > make the formatting look the same as it does for an unstructured array? > > Her

[Numpy-discussion] printing structured arrays

2010-03-05 Thread Bruce Schultz
Hi, I've just started playing with numpy and have noticed that when printing a structured array that the output is not nicely formatted. Is there a way to make the formatting look the same as it does for an unstructured array? Here an example of what I mean: data = [ (1, 2), (3, 4.1) ] dtype = [