[Python-es] pytables/hdf5 to ascii/csv/excel

Kiko kikocorreoso en gmail.com
Jue Dic 23 10:36:13 CET 2010


Hola a todos.

El problema es el siguiente:

Tengo tablas en ficheros hdf5 y me gustaría pasar las tablas a ficheros
excel (o csv/ascii) a pelo.

He estado investigando por ahí y una respuesta de Francesc Alted a esta
pregunta la leo en [1] y dice lo siguiente:
*
*

*> What python tools are recommended to convert hdf5 tables to
> ascii/csv?

In general, it is best to retrieve NumPy objects out of PyTables ones,
and then use the NumPy/Python output capabilities to generate the
desired ascii/csv files.  If in doubt, ask the NumPy list for how to do
this efficiently (I've read that they are working on improved methods
for output arrays in different ascii formats).*

Esto se podría hacer usando numpy.savetxt [2]

Otra opción sería usar h5dump [3].

La pregunta es, ¿habría alguna forma más rápida y directa de poder pasar una
tabla hdf5 a un fichero ascii/csv/excel en python/numpy?

Gracias y feliz navidad a todos.

[1] http://blog.gmane.org/gmane.comp.python.pytables.user/month=20090101
[2]
http://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html#numpy.savetxt
[3] http://www.hdfgroup.org/HDF5-FAQ.html#toexcel
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20101223/0c409b94/attachment.html>


Más información sobre la lista de distribución Python-es