Dataset¶
-
class
bth5.
Dataset
(filename, path, mode='r', value_dtype=None)[source]¶ Represents a bitemporal dataset as a memory-mapped structure stored in HDF5.
Examples
>>> ds = bth5.Dataset(temp_h5, '/path/to/group', mode='a', value_dtype=np.float64) >>> with ds: ... ds.write(np.datetime64("2018-06-21 12:26:47"), 2.0) >>> # Write happens here. >>> with ds: ... ds.valid_times[:] array([(0, '2018-06-21T12:26:47.000000', 2.)], dtype=[('transaction_id', '<u8'), ('valid_time', '<M8[us]'), ('value', '<f8')])
Attributes
The dtype of this dataset.
The dtype stored in the file.
Methods
Dataset.__init__
(filename, path[, mode, …])Creates a
Dataset
.Close the current file handle.
Dataset.interpolate_values
(interp_times)Interpolates the values at the given valid times.
Dataset.open
([mode])Opens the file for various operations
Dataset.write
(valid_time, value)Appends data to a dataset.
Indexers
Index into the dataset by record ID.
Index into the transaction index by transaction time.
Index into the transaction index by transaction ID.
Indexes into the dataset by transaction ID.
Indexes into the dataset by valid time.