Pandas: HDFStore method to get the columns from a table

Created on 4 Apr 2014  路  5Comments  路  Source: pandas-dev/pandas

I have some frames that have 44 ish columns with names I can't really remember. I think it might be useful to be able to do something like

store.get_index('hdf5/table', axis=1)

which would return the columns of hdf5/table. @jreback thoughts?

API Design Enhancement IO HDF5

Most helpful comment

This is also a nice feature for large datasets, as one doesn't need to lead the whole table in memory just to view column names if one uses the method @cpcloud describes.

All 5 comments

Right now I'm doing store.get_storer(key).non_index_axes[0][1].

hmm

that looks good

only caveat is that axis 1 is just a trivial meta data read while axis 0 actually has to select_column (and user might by except this) but as long as it's doc ed guess it's ok

eh i'll just rename my columns to something more meaningful .. this probably not worith it.

actually I think this is a nice idea

let's leave open

This is also a nice feature for large datasets, as one doesn't need to lead the whole table in memory just to view column names if one uses the method @cpcloud describes.

Was this page helpful?
0 / 5 - 0 ratings