Columns and rows¶
A generic container for immutable data that can be accessed either by numeric index or by key. |
|
Proxy access to column data. |
|
A row of data. |
- class agate.MappedSequence(values, keys=None)¶
A generic container for immutable data that can be accessed either by numeric index or by key. This is similar to an
collections.OrderedDictexcept that the keys are optional and iteration over it returns the values instead of keys.This is the base class for both
ColumnandRow.- Parameters:
values – A sequence of values.
keys – A sequence of keys.
- class agate.Column(index, name, data_type, rows, row_names=None)¶
Proxy access to column data. Instances of
Columnshould not be constructed directly. They are created byTableinstances and are unique to them.Columns are implemented as subclass of
MappedSequence. They deviate from the underlying implementation in that loading of their data is deferred until it is needed.- Parameters:
name – The name of this column.
data_type – An instance of
DataType.rows – A
MappedSequencethat contains theRowinstances containing the data for this column.row_names – An optional list of row names (keys) for this column.
- class agate.Row(values, keys=None)¶
A row of data. Values within a row can be accessed by column name or column index. Row are immutable and may be shared between
Tableinstances.Currently row instances are a no-op subclass of
MappedSequence. They are being maintained in this fashion in order to support future features.