ptypy.utils.misc.Table#
- class ptypy.utils.misc.Table(dct, name='pods')#
Bases:
objectBasic table implemented using numpy.recarray Ideally subclassed to be used with faster or more flexible databases.
- __init__(dct, name='pods')#
Methods
__init__(dct[, name])add_records(records)Add records at the end of the table.
insert_records(records, record_ids)Insert records and overwrite existing content.
modify_add(record_ids, **kwargs)Take selected record ids and overwrite fields with values **kwargs.
new_fields(**kwargs)Add fields (columns) to the table.
new_table([records])pull_records([record_ids])select_func(func[, fields])Find all records where search function func evaluates True.
select_match(field, match)Find all records whose values are in the range [low,`high`] for the field entry field
select_range(field, low, high)Find all records whose values are in the range [low,`high`] for the field entry field.
- add_records(records)#
Add records at the end of the table.
- insert_records(records, record_ids)#
Insert records and overwrite existing content.
- modify_add(record_ids, **kwargs)#
Take selected record ids and overwrite fields with values **kwargs.
- new_fields(**kwargs)#
Add fields (columns) to the table. This is probably slow.
- select_func(func, fields=None)#
Find all records where search function func evaluates True. Arguments to the function are selected by fields. The search function will always receive the record_id as first argument.
- select_match(field, match)#
Find all records whose values are in the range [low,`high`] for the field entry field
- select_range(field, low, high)#
Find all records whose values are in the range [low,`high`] for the field entry field. Should be a numerical value.