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 gokhanse...@gmail.com wrote: On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz bruce.schu...@gmail.com wrote: Output is: ### ndarray [[ 1. 2. ] [ 3. 4.1]] ### structured array [(1.0, 2.0)

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

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread josef . pktd
On Mon, Mar 8, 2010 at 5:50 PM, Tim Michelsen timmichel...@gmx-topmail.de 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

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.

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 function

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 timmichel...@gmx-topmail.de 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

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 dtypes are sparse

Re: [Numpy-discussion] printing structured arrays

2010-03-09 Thread Bruce Schultz
On Sat, Mar 6, 2010 at 8:35 AM, Gökhan Sever gokhanse...@gmail.com wrote: On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz bruce.schu...@gmail.com wrote: Output is: ### ndarray [[ 1.   2. ]  [ 3.   4.1]] ### structured array [(1.0, 2.0) (3.0, 4.0996)] Thanks Bruce I

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

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen timmichel...@gmx-topmail.de 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

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Skipper Seabold
On Mon, Mar 8, 2010 at 2:01 PM, josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen timmichel...@gmx-topmail.de 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

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold jsseab...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:01 PM,  josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen timmichel...@gmx-topmail.de wrote: Hello, I am also looking into the convertsion from strcutured arrays to

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread Skipper Seabold
On Mon, Mar 8, 2010 at 2:17 PM, josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold jsseab...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:01 PM,  josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at 1:55 PM, Tim Michelsen timmichel...@gmx-topmail.de wrote: Hello, I am

Re: [Numpy-discussion] printing structured arrays

2010-03-08 Thread josef . pktd
On Mon, Mar 8, 2010 at 2:24 PM, Skipper Seabold jsseab...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:17 PM,  josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:04 PM, Skipper Seabold jsseab...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:01 PM,  josef.p...@gmail.com wrote: On Mon, Mar 8, 2010 at

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 make the

[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 =

Re: [Numpy-discussion] printing structured arrays

2010-03-05 Thread Gökhan Sever
On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz bruce.schu...@gmail.comwrote: 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