This module contains the Column class, which defines a “vertical” array of tabular data. Whereas Row instances are independent of their parent Table, columns depend on knowledge of both their position in the parent (column name, data type) as well as the rows that contain their data.


Key method for sorting nulls correctly.

class agate.columns.Column(index, name, data_type, rows, row_names=None)

Proxy access to column data. Instances of Column should not be constructed directly. They are created by Table instances 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.

  • name – The name of this column.
  • data_type – An instance of DataType.
  • rows – A MappedSequence that contains the Row instances containing the data for this column.
  • row_names – An optional list of row names (keys) for this column.

This column’s index.


This column’s name.


This column’s data type.


Get the data contained in this column with any null values removed.


Get the data contained in this column sorted.


Get the data contained in this column with any null values removed and sorted.


Apply a Aggregation to this column and return the result. If the aggregation defines a cache_key the result will be cached for future requests.