|
From: Francesc A. <fa...@ca...> - 2006-02-13 14:07:37
|
El dl 13 de 02 del 2006 a les 08:35 -0500, en/na Alan G Isaac va
escriure:
> >> Is anybody actually using both names and titles?=20
>=20
> On Mon, 13 Feb 2006, Francesc Altet apparently wrote:=20
> > Not me.=20
>=20
> Is the "title" the appropriate storage for the "displayname"
> for fields that are to be plotted? Or not?
Uh, yes. Perhaps I messed up things. Of course it is interesting to have
both a name and a title. What I tried to mean is that accessing fields
by *both* names and titles might introduce confusion. For example,
allowing:
>>> mydata =3D [(1,1), (2,4), (3,9)]
>>> mytype =3D {'names': ['col1','col2'], 'formats':['i2','f4'],'titles':
['col 2', 'col 1']}
>>> b =3D numpy.array( mydata, dtype=3Dmytype)
>>> b
array([(1, 1.0), (2, 4.0), (3, 9.0)], dtype=3D(void,6))
>>> b['col1']
array([1, 2, 3], dtype=3Dint16)
>>> b['col 2']
array([1, 2, 3], dtype=3Dint16)
seems quite strange to me. My point is that I think that keys in arrays
for accessing fields should be unique, and thus, I'd remove the last
sentence as a valid one.
But of course I think that having both names and titles is a good thing.
Sorry for the confusion.
Cheers,
--=20
>0,0< Francesc Altet http://www.carabos.com/
V V C=E1rabos Coop. V. Enjoy Data
"-"
|