datascience.tables.Table.column_index

Table.column_index(label)[source]

Return the index of a column by looking up its label.

Args:

label (str) – label value of a column

Returns:

integer value specifying the index of the column label

Example:

>>> t = Table().with_columns({
...     'letter': ['a', 'b', 'c', 'z'],
...     'count':  [  9,   3,   3,   1],
...     'points': [  1,   2,   2,  10],
... })
>>> t.column_index('letter')
0