Package picalo :: Package base :: Module TableList :: Class TableList
[show private | hide private]
[frames | no frames]

Type TableList

object --+    
         |    
      list --+
             |
            TableList


Method Summary
  __init__(self, *args, **kargs)
A list of picalo tables.
  __add__(self, other)
  __getitem__(self, index)
  __getslice__(self, i, j)
  __mul__(self, other)
  __setitem__(self, key, value)
  __setslice__(self, i, j, sequence)
  __sub__(self, other)
  append(self, value)
  append_calculated(self, name, expression)
This method is not supported in TableLists.
  append_calculated_static(self, name, column_type, expression)
This method is not supported in TableLists.
  append_column(self, name, column_type, values)
This method is not supported in TableLists.
  clear_filter(self)
This method is not supported in TableLists.
  column(self, col)
This method is not supported in TableLists.
  column_count(self)
This method is not supported in TableLists.
  delete_column(self, column)
This method is not supported in TableLists.
  filter(self, expression)
This method is not supported in TableLists.
  get_column_names(self)
This method is not supported in TableLists.
  get_columns(self)
This method is not supported in TableLists.
  guess_types(self, num_records)
This method is not supported in TableLists.
  insert_calculated(self, index, name, expression)
This method is not supported in TableLists.
  insert_calculated_static(self, index, name, column_type, expression)
This method is not supported in TableLists.
  insert_column(self, index, name, column_type, values)
This method is not supported in TableLists.
  is_changed(self)
Returns whether the table has been changed since loading
  is_filtered(self)
Returns whether the first table in this list is filtered.
  move_column(self, column, new_index)
This method is not supported in TableLists.
  save(self, filename, respect_filter)
Saves this TableList in native Picalo format.
  save_csv(self, filename, line_ending, none, encoding, respect_filter)
Saves this TableList in CSV format.
  save_delimited(self, filename, delimiter, qualifier, line_ending, none, encoding, respect_filter)
Saves this TableList in delimited format.
  save_fixed(self, filename, line_ending, none, respect_filter)
Saves this TableList in fixed format.
  save_tsv(self, filename, line_ending, none, encoding, respect_filter)
Saves this TableList in tsv format.
  save_xml(self, filename, line_ending, indent, compact, none, respect_filter)
Saves this TableList in xml format.
  set_changed(self, changed)
Sets whether the class has been changed since loading.
  set_format(self, column, format)
This method is not supported in TableLists.
  set_name(self, column, name)
This method is not supported in TableLists.
  set_readonly(self, readonly_flag)
Sets the read only status of this table.
  set_type(self, column, column_type, format, expression)
This method is not supported in TableLists.
  structure(self)
This method is not supported in TableLists.
  view(self)
Opens the table list for viewing in the Picalo user interface.
    Inherited from list
  __contains__(x, y)
x.__contains__(y) <==> y in x
  __delitem__(x, y)
x.__delitem__(y) <==> del x[y]
  __delslice__(x, i, j)
Use of negative indices is not supported.
  __eq__(x, y)
x.__eq__(y) <==> x==y
  __ge__(x, y)
x.__ge__(y) <==> x>=y
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __gt__(x, y)
x.__gt__(y) <==> x>y
  __hash__(x)
x.__hash__() <==> hash(x)
  __iadd__(x, y)
x.__iadd__(y) <==> x+=y
  __imul__(x, y)
x.__imul__(y) <==> x*=y
  __iter__(x)
x.__iter__() <==> iter(x)
  __le__(x, y)
x.__le__(y) <==> x<=y
  __len__(x)
x.__len__() <==> len(x)
  __lt__(x, y)
x.__lt__(y) <==> x<y
  __ne__(x, y)
x.__ne__(y) <==> x!=y
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __repr__(x)
x.__repr__() <==> repr(x)
  __reversed__(...)
L.__reversed__() -- return a reverse iterator over the list
  __rmul__(x, n)
x.__rmul__(n) <==> n*x
  count(L, value)
L.count(value) -> integer -- return number of occurrences of value
  extend(...)
L.extend(iterable) -- extend list by appending elements from the iterable
  index(...)
L.index(value, [start, [stop]]) -> integer -- return first index of value
  insert(...)
L.insert(index, object) -- insert object before index
  pop(L, index)
L.pop([index]) -> item -- remove and return item at index (default last)
  remove(...)
L.remove(value) -- remove first occurrence of value
  reverse(...)
L.reverse() -- reverse *IN PLACE*
  sort(...)
L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, *args, **kargs)
(Constructor)

A list of picalo tables. Some functions in Picalo return a set of tables. Sets of tables are returned as TableList objects.

Users do not normally create TableLists. They are created automatically by Picalo functions.

TableLists are a weaker form of TableArrays. While TableArrays must have compatible tables, TableLists can hold tables of different schema. TableLists can be viewed in the Picalo GUI, but they cannot be sent into most Picalo functions.
Overrides:
__builtin__.list.__init__

append_calculated(self, name, expression)

This method is not supported in TableLists. Use TableArrays if this method is required.

append_calculated_static(self, name, column_type, expression)

This method is not supported in TableLists. Use TableArrays if this method is required.

append_column(self, name, column_type, values=None)

This method is not supported in TableLists. Use TableArrays if this method is required.

clear_filter(self)

This method is not supported in TableLists. Use TableArrays if this method is required.

column(self, col)

This method is not supported in TableLists. Use TableArrays if this method is required.

column_count(self)

This method is not supported in TableLists. Use TableArrays if this method is required.

delete_column(self, column)

This method is not supported in TableLists. Use TableArrays if this method is required.

filter(self, expression=None)

This method is not supported in TableLists. Use TableArrays if this method is required.

get_column_names(self)

This method is not supported in TableLists. Use TableArrays if this method is required.

get_columns(self)

This method is not supported in TableLists. Use TableArrays if this method is required.

guess_types(self, num_records=-1)

This method is not supported in TableLists. Use TableArrays if this method is required.

insert_calculated(self, index, name, expression)

This method is not supported in TableLists. Use TableArrays if this method is required.

insert_calculated_static(self, index, name, column_type, expression)

This method is not supported in TableLists. Use TableArrays if this method is required.

insert_column(self, index, name, column_type, values=None)

This method is not supported in TableLists. Use TableArrays if this method is required.

is_changed(self)

Returns whether the table has been changed since loading

is_filtered(self)

Returns whether the first table in this list is filtered.

move_column(self, column, new_index)

This method is not supported in TableLists. Use TableArrays if this method is required.

save(self, filename, respect_filter=False)

Saves this TableList in native Picalo format. This is the preferred format to save TableLists in because all column types, formulas, and so forth are saved.
Parameters:
filename - The filename to save to. This can also be an open stream.
           (type=str @param respect_filter Whether to save the entire file or only those rows available through any current filters. @type respect_filter bool)

save_csv(self, filename, line_ending='\n', none='', encoding='utf-8', respect_filter=False)

Saves this TableList in CSV format. Since the table list probably has multiple tables in it, one CSV per table is created by prepending 1, 2, 3 to the filename.
Parameters:
filename - A file name or a file pointer to an open file. Using the file name string directly is suggested since it ensures the file is opened correctly for reading in CSV.
           (type=str)
line_ending - An optional line ending to separate rows with
           (type=str)
none - An optional parameter specifying what to write for cells that have the None value.
           (type=str)
encoding - The unicode encoding to use for international or special characters. For example, Microsoft applications like to use special characters for double quotes rather than the standard characters. Unicode (the default) handles these nicely.
           (type=str @param respect_filter Whether to save the entire file or only those rows available through any current filter. @type respect_filter bool)

save_delimited(self, filename, delimiter=',', qualifier='"', line_ending='\n', none='', encoding='utf-8', respect_filter=False)

Saves this TableList in delimited format. Since the table list probably has multiple tables in it, one delimited file per table is created by prepending 1, 2, 3 to the filename.
Parameters:
filename - A file name or a file pointer to an open file. Using the file name string directly is suggested since it ensures the file is opened correctly for reading in CSV.
           (type=str)
delimiter - An optional field delimiter character
           (type=str)
qualifier - An optional qualifier to use when delimiters exist in field values
           (type=str)
line_ending - An optional line ending to separate rows with
           (type=str)
none - An optional parameter specifying what to write for cells that have the None value.
           (type=str)
encoding - The unicode encoding to use for international or special characters. For example, Microsoft applications like to use special characters for double quotes rather than the standard characters. Unicode (the default) handles these nicely.
           (type=str @param respect_filter Whether to save the entire file or only those rows available through any current filter. @type respect_filter bool)

save_fixed(self, filename, line_ending='\n', none='', respect_filter=False)

Saves this TableList in fixed format. Since the table list probably has multiple tables in it, one fixed file per table is created by prepending 1, 2, 3 to the filename.
Parameters:
filename - A file name or a file pointer to an open file. Using the file name string directly is suggested since it ensures the file is opened correctly for reading in CSV.
           (type=str)
line_ending - An optional line ending to separate rows with
           (type=str)
none - An optional parameter specifying what to write for cells that have the None value.
           (type=str @param respect_filter Whether to save the entire file or only those rows available through any current filter. @type respect_filter bool)

save_tsv(self, filename, line_ending='\n', none='', encoding='utf-8', respect_filter=False)

Saves this TableList in tsv format. Since the table list probably has multiple tables in it, one tsv file per table is created by prepending 1, 2, 3 to the filename.
Parameters:
filename - A file name or a file pointer to an open file. Using the file name string directly is suggested since it ensures the file is opened correctly for reading in CSV.
           (type=str)
line_ending - An optional line ending to separate rows with
           (type=str)
none - An optional parameter specifying what to write for cells that have the None value.
           (type=str)
encoding - The unicode encoding to use for international or special characters. For example, Microsoft applications like to use special characters for double quotes rather than the standard characters. Unicode (the default) handles these nicely.
           (type=str)

save_xml(self, filename, line_ending='\n', indent='\t', compact=False, none='', respect_filter=False)

Saves this TableList in xml format. Since the table list probably has multiple tables in it, one xml file per table is created by prepending 1, 2, 3 to the filename.
Parameters:
filename - A file name or a file pointer to an open file. Using the file name string directly is suggested since it ensures the file is opened correctly for reading in CSV.
           (type=str)
line_ending - An optional line ending to separate rows with (when compact is False)
           (type=str)
indent - The character(s) to use for indenting (when compact is False)
           (type=str)
compact - Whether to compact the XML or make it "pretty" with whitespace
           (type=bool)
none - An optional parameter specifying what to write for cells that have the None value.
           (type=str @param respect_filter Whether to save the entire file or only those rows available through any current filter. @type respect_filter bool)

set_changed(self, changed)

Sets whether the class has been changed since loading. This is not normally called by users.

set_format(self, column, format=None)

This method is not supported in TableLists. Use TableArrays if this method is required.

set_name(self, column, name)

This method is not supported in TableLists. Use TableArrays if this method is required.

set_readonly(self, readonly_flag=False)

Sets the read only status of this table. Tables that are read only cannot be modified. Normally, tables are initially not read only (i.e. can be modified). The only exception is tables loaded from databases, which are read only.
Parameters:
readonly_flag - True or False, depending upon whether the table should be read only or not.
           (type=bool)

set_type(self, column, column_type=None, format=None, expression=None)

This method is not supported in TableLists. Use TableArrays if this method is required.

structure(self)

This method is not supported in TableLists. Use TableArrays if this method is required.

view(self)

Opens the table list for viewing in the Picalo user interface. The resulting view allows you to page through the tables in the list. See the first example.

You can view individual tables in the list by using the [n] notation. See the second example for this notation.

Example:
>>> data = Table([
...   ('id', int),
...   ('name', unicode),
... ],[
...   [ 1, 'Benny' ],
...   [ 2, 'Vijay' ],
... ])
>>> tables = Grouping.stratify_by_value(data, 'id')
>>> tables.view()
Example:
>>> data = Table([
...   ('id', int),
...   ('name', unicode),
... ],[
...   [ 1, 'Benny' ],
...   [ 2, 'Vijay' ],
... ])
>>> tables = Grouping.stratify_by_value(data, 'id')
>>> tables[0].view()

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net