MCPcopy Create free account
hub / github.com/PyTables/PyTables / Table

Class Table

tables/table.py:384–3241  ·  view source on GitHub ↗

This class represents heterogeneous datasets in an HDF5 file. Tables are leaves (see the Leaf class in :ref:`LeafClassDescr`) whose data consists of a unidimensional sequence of *rows*, where each row contains one or more *fields*. Fields have an associated unique *name* and *posit

Source from the content-addressed store, hash-verified

382
383
384class Table(tableextension.Table, Leaf):
385 """This class represents heterogeneous datasets in an HDF5 file.
386
387 Tables are leaves (see the Leaf class in :ref:`LeafClassDescr`) whose data
388 consists of a unidimensional sequence of *rows*, where each row contains
389 one or more *fields*. Fields have an associated unique *name* and
390 *position*, with the first field having position 0. All rows have the same
391 fields, which are arranged in *columns*.
392
393 Fields can have any type supported by the Col class (see
394 :ref:`ColClassDescr`) and its descendants, which support multidimensional
395 data. Moreover, a field can be *nested* (to an arbitrary depth), meaning
396 that it includes further fields inside. A field named x inside a nested
397 field a in a table can be accessed as the field a/x (its *path name*) from
398 the table.
399
400 The structure of a table is declared by its description, which is made
401 available in the Table.description attribute (see :class:`Table`).
402
403 This class provides new methods to read, write and search table data
404 efficiently. It also provides special Python methods to allow accessing
405 the table as a normal sequence or array (with extended slicing supported).
406
407 PyTables supports *in-kernel* searches working simultaneously on several
408 columns using complex conditions. These are faster than selections using
409 Python expressions. See the :meth:`Table.where` method for more
410 information on in-kernel searches.
411
412 Non-nested columns can be *indexed*. Searching an indexed column can be
413 several times faster than searching a non-nested one. Search methods
414 automatically take advantage of indexing where available.
415
416 When iterating a table, an object from the Row (see :ref:`RowClassDescr`)
417 class is used. This object allows to read and write data one row at a
418 time, as well as to perform queries which are not supported by in-kernel
419 syntax (at a much lower speed, of course).
420
421 Objects of this class support access to individual columns via *natural
422 naming* through the :attr:`Table.cols` accessor. Nested columns are
423 mapped to Cols instances, and non-nested ones to Column instances.
424 See the Column class in :ref:`ColumnClassDescr` for examples of this
425 feature.
426
427 Parameters
428 ----------
429 parentnode
430 The parent :class:`Group` object.
431
432 .. versionchanged:: 3.0
433 Renamed from *parentNode* to *parentnode*.
434
435 name : str
436 The name of this node in its parent group.
437 description
438 An IsDescription subclass or a dictionary where the keys are the field
439 names, and the values the type definitions. In addition, a pure NumPy
440 dtype is accepted. If None, the table metadata is read from disk,
441 else, it's taken from previous parameters.

Callers 2

_g_copy_with_statsMethod · 0.85
create_tableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected