qubx :: table :: Table :: Class Table
[hide private]
[frames] | no frames]

Class Table

source code

object --+
         |
        Table
Known Subclasses:

Base class for info that can be represented as a table.

Instance Methods [hide private]
 
__init__(self, sortable=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
dispose(self)
Releases references to improve chances of garbage collection.
source code
 
set_global_name(self, x) source code
 
__len__(self) source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, val) source code
 
__iter__(self) source code
 
__str__(self)
str(x)
source code
 
to_text(self, separator='\t') source code
 
from_text(self, txt, keep_fields=False) source code
 
to_json(self) source code
 
from_json(self, json) source code
 
append(self, entry)
equivalent to table.insert(table.size, entry)
source code
 
insert(self, i, entry, undoing=False) source code
 
remove(self, i, undoing=False) source code
 
get(self, i, field_name) source code
 
set(self, i, field_name, val, undoing=False) source code
 
select(self, i, field_name=None, sender=None)
Triggers OnSelect.
source code
 
clear(self)
Removes all rows.
source code
 
get_row(self, i, safenames=False)
Returns a the i'th TableRow.
source code
 
all_rows(self)
Returns a list of TableRow.
source code
 
index(self, name, raise_error=True)
Returns the index of the first row with "Name"==name.
source code
 
__onInsert(self, i, undoing=False) source code
 
__onRemoved(self, i, undoing=False) source code
 
set_checked(self, i, checked=True) source code
 
get_by_name(self, name, field)
Returns the value of field, in the first row with "Name"=name; or raises KeyError.
source code
 
get_row_by_name(self, name)
Returns a TableRow for the first row with "Name"=name; or raises KeyError.
source code
 
rows_meeting_criteria(self, expr, row_count=None) source code
 
copy_rows_from(self, table, copy_rows_type=0, group=1, inverse=False, criteria='', on_copy=None) source code
 
check_rows_if(self, copy_rows_type=0, group=1, inverse=False, criteria='', on_copy=None) source code
 
calc_expr_values(self, expr, indices=None) source code
 
add_field_to_stats(self, field_name) source code
 
remove_field_from_stats(self, field_name) source code
 
__mean(self, field_name, group=None) source code
 
__std(self, field_name, group=None) source code
 
__median(self, field_name, group=None) source code
 
__mode(self, field_name, group=None) source code
 
__groups_occupied(self, include_zero=False) source code
 
__rows_in_group(self, group) source code
 
__count_in_group(self, group) source code
 
nb_get_caption(self) source code
 
nb_get_shape(self) source code
 
nb_get_headers(self) source code
 
nb_get_row(self, r) source code
 
nb_get_col(self, c) source code
 
nb_get_col_format(self, c) source code
 
nb_get_type(self, fields=None) source code
 
add_notebook_item(self, name, item) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]
  global_name
how to locate self in global namespace, if possible
  size
the number of rows
  OnAddField
WeakEvent(name) called when a field is added
  OnAfterInsert
WeakEvent(index, undoing) called after insertion and all OnInsert callbacks (.set(...) if you like)
  OnChecked
WeakEvent(index, checked) called on set_checked
  OnDoubleClick
WeakEvent(index, field_name or None) called (e.g.
  OnInsert
WeakEvent(index, undoing) called when a row is added (read-only please)
  OnRemoved
WeakEvent(index, undoing) called when a row was just removed
  OnRemoving
WeakEvent(index, undoing) called when a row is about to be removed
  OnRemovingField
WeakEvent(name) called when a field is being removed
  OnSelect
WeakEvent(index, field_name or None, sender or None) called when a row is highlighted
  OnSet
WeakEvent(index, field_name, val, prev, undoing) called when one field of a row is changed
  accept
dict: field name -> conversion_function(string)->value; can raise Exception on invalid input
  all_stats
field_stats + group_stats
  checked
list[row index] of bool, should row be included in batch actions
  choices
dict: field name -> (list of values to choose among) or None
  count_in_group
f(group) -> number of rows with Group==group
  default
dict: field name -> default value
  field_stats
{field_name : [mean, std, median, mode]}
  fields
list of field names
  fields_independent
list of field names marked independent e.g.
  format
dict: field name -> format_function(value)->string
  group_stats
[groups_occupied, rows_in_group, count_in_group]
  groups_occupied
f(include_zero=False) -> sorted list of 'Group' values, no duplicates, possibly no 0
  label
the table's name
  mean
{field_name : f(group=None) -> mean value of field for all segments or group index}
  median
{field_name : f(group=None) -> median value of field for all segments or group index}
  mode
{field_name : f(group=None) -> most common value of field for all segments or group index}
  rows_in_group
f(group) -> list of row indices with Group==group
  sortable
(def False) whether the user should be able to sort by column
  std
{field_name : f(group=None) -> std deviation of field for all segments or group index}
  units
dict: field name -> units_string
  user_can_remove
list[row index] of bool, can remove via gui; def True
Properties [hide private]
  __global_name
  __ref
  custom
  max_bools
  max_fields
  notebook
  notebook_items

Inherited from object: __class__

Method Details [hide private]

__init__(self, sortable=False)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

select(self, i, field_name=None, sender=None)

source code 

Triggers OnSelect.

This mechanism is provided so that, if there are two or more views on a table, you can select an item in one and it will be selected in the other(s). A view calls select with sender=self so it can ignore its own selection activity.


Instance Variable Details [hide private]

global_name

how to locate self in global namespace, if possible
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

size

the number of rows
Get Method:
unreachable(self)

OnDoubleClick

WeakEvent(index, field_name or None) called (e.g. by TableView) when a row is double-clicked

fields_independent

list of field names marked independent e.g. 'Index'