ralhei / pyRserve

A python client for Rserve (network layer to remote R server)
Other
48 stars 13 forks source link

TaggedList is unnecessary for data.frames #2

Closed flying-sheep closed 7 years ago

flying-sheep commented 10 years ago

see here

>>> a = np.array([('a', 1), ('b', 2)], dtype=[('h1', '<U1'), ('h2', '<i4')])
>>> a['h1']
array(['a', 'b'], dtype='<U1')
>>> a[a.dtype.names[0]]
array(['a', 'b'], dtype='<U1')
>>> a[0]
('a', 1)

and if we really need easy indexing by col number, this class is better in every respect (performance, versatility, …)

ralhei commented 10 years ago

Hi, sorry for the very late reply, this message just slipped through. You are right, the TaggedList class is just a stupid helper class because I didn't find anything appropriate (without putting too much research into it, to be honest ...) What I definitely want to avoid is a dependency to any other major package just for the sake of replacing this class, which is why I'm not too keen to borough anything from the pydata project in the moment.