cogent3.util.table.Columns#
- class Columns#
Collection of columns. iter operates over columns.
- Attributes
array
object array of all columns
index_name
column name whose values can be used to index table rows
order
column order
Methods
add_column_from_str
(name, values)adds a column from series of str
clear
()get
(k[,d])items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
setdefault
(k[,d])take_columns
(columns)returns new Columns instance with just columns
to_dict
()returns column based dict
update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()iter_rows
to_rich_dict