apptools.io.h5.table_node module

class apptools.io.h5.table_node.H5TableNode(node)[source]

Bases: object

A wrapper for PyTables Table nodes.

Parameters

node (tables.Table instance) – An H5 node which is a pytables.Table or H5TableNode instance

classmethod add_to_h5file(h5, node_path, description, **kwargs)[source]

Add table node to an H5 file at the specified path.

Parameters
  • h5 (H5File) – The H5 file where the table node will be stored.

  • node_path (str) – Path to node where data is stored (e.g. ‘/path/to/my_table’)

  • description (list of tuples or numpy dtype object) – The description of the columns in the table. This is either a list of (column name, dtype, [, shape or itemsize]) tuples or a numpy record array dtype. For more information, see the documentation for Table in PyTables.

  • **kwargs (dict) – Additional keyword arguments to pass to pytables.File.create_table

append(data)[source]

Add some data to the table.

Parameters

data (dict) – A dictionary of column name -> values items

classmethod is_table_node(pytables_node)[source]

Return True if pytables_node is a pytables.Table or a H5TableNode.

property ix

Return an object which provides access to row data.

keys()[source]
to_dataframe()[source]

Return table data as a pandas DataFrame.

XXX: This does not work if the table contains a multidimensional column

This method requires pandas to have been installed in the environment.