← Back to team overview

larry-discuss team mailing list archive

New features: totuples, fromtuples

 

(first mail: not sure how well it works, since I cannot just reply to
previous thread)

I was trying to get a bit of an overview how fromxxx and toxxx work in
pandas and tabular and scikits.statsmodels. It would be good to have
methods or functions that make the conversion between different
packages easier.

For example, the toDict method of pandas creates a hierarchical
dictionary instead of tuple keys.
The totuples looks close to structured arrays, so it might be possible
to extend it to torecords, fromrecords. However, totuples creates a
"long" format while structured arrays are 2d. pandas and, I think,
also tabular allow to unflatten, convert long to wide, but for
structured arrays a 2d table might be more convenient.

To method versus function: numpy and scikits.statsmodels use factory
functions fromxxx, tabular and pandas use classmethods (I think). The
latter is actually easier to find in the docs, since the list of
methods shows both the fromxxx and the toxxx methods.

Josef



Follow ups