[Numpy-discussion] changing display options for dtype info for record arrays

JJ josh8912@yahoo....
Sat Feb 16 03:52:21 CST 2008


Hello:
I am starting to use record arrays and would like to
know how to keep numpy from displaying the dtype info.
 For example, I can make a record array containing a
long tuple:

mydescriptor = dtype([('first', 'f4'),('second',
'f4'), ('third', [(str(x),'<i2') for x in range(1000)]
 )])

myarr = rec.array( [(1.2, 4.5, tuple([x for x in
range(1000)]) )], dtype= mydescriptor )

If in a terminal I type "myarr" and hit return, I get
a printout of the data and then a very long list of
dtype information.  Is there some way to turn this
feature off so that only the data is displayed?  I
realize that "print myarr" does not produce the long
dtype list.  Also, is there an easier way to set the
format for the long tuple, such as using ('third',
'tuple') or some such expression?  I know that 'tuple'
is not a dtype, just thought there might be some
shortcut for formatting long tuples in a rec array.
Thanks,  John 




      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


More information about the Numpy-discussion mailing list