Dumping objects into spreadsheet readable text (design question)

_ webb.sprague at gmail.com
Wed Jan 3 18:52:17 EST 2007


Hi Pythonistas and Pythonistos,

I am doing some fairly complex statistical analyses and trying to
display the output in a form readable to technicians not yet
enlightened by the wonders of python (ie they still use either Excel,
S-PLUS/R, or Matlab only).  I need to dump the results into text such
that these users can do further processing, and I am looking for ideas
on good ways to do this.

Note that formatting and displaying simple lists of named coeffecients
or tables would easy; the problem is that these analyses (Lee-Carter
mortality forecasts, for anyone who cares) require at least a single
two-dimensional matrix of rates and ~12 scalar coefficients, and they
generate 4 two-dimensional matrices, several three-dimensional
matrices, and 20 or so scalar coefficients.  Each of these pieces of
data also has a canonical name with which they must be labeled in the
output.  All of these pieces of data go together.  Finally, I would
like to find some way to do this generally, so when my boss comes up
with a new analysis I can re-use this text dump code.

Has anybody done this?

I am thinking of using cheetah, but I am still pondering design, hoping
for list inspiration!

pprint won't work because users will want to import into a spreadsheet,
and it displays lots of "{" etc.

Feel free to cc me on the reply, as I read the list as digest.

TIA




More information about the Python-list mailing list