Module littletable :: Class PivotTable
[frames] | no frames]

Class PivotTable

source code

object --+    
         |    
     Table --+
             |
            PivotTable

Enhanced Table containing pivot results from calling table.pivot().

Instance Methods
 
__init__(self, parent, attr_val_path, attrlist)
PivotTable initializer - do not create these directly, use Table.pivot.
source code
 
__getitem__(self, val)
Provides direct indexed/sliced access to the Table's underlying list of objects.
source code
 
keys(self) source code
 
items(self) source code
 
values(self) source code
 
pivot_key(self)
Return the set of attribute-value pairs that define the contents of this table within the original source table.
source code
 
pivot_key_str(self)
Return the pivot_key as a displayable string.
source code
 
has_subtables(self)
Return whether this table has further subtables.
source code
 
dump(self, out=sys.stdout, row_fn=<built-in function repr>, limit=-1, indent=0)
Dump out the contents of this table in a nested listing.
source code
 
dump_counts(self, out=sys.stdout, count_fn=<built-in function len>, colwidth=10)
Dump out the summary counts of entries in this pivot table as a tabular listing.
source code
 
summary_counts(self, fn=None, col=None, summarycolname=None)
Dump out the summary counts of this pivot table as a Table.
source code

Inherited from Table: __add__, __bool__, __call__, __getattr__, __iadd__, __iter__, __len__, __nonzero__, add_field, addfield, clone, copy_template, create_index, csv_export, csv_import, delete, delete_index, format, groupby, insert, insert_many, join, join_on, json_export, json_import, pivot, remove, remove_many, run, select, sort, tsv_import, union, unique, where

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

Instance Variables

Inherited from Table: by

Properties

Inherited from object: __class__

Method Details

__init__(self, parent, attr_val_path, attrlist)
(Constructor)

source code 

PivotTable initializer - do not create these directly, use Table.pivot.

Parameters:
  • table_name - name for Table
Overrides: object.__init__

__getitem__(self, val)
(Indexing operator)

source code 

Provides direct indexed/sliced access to the Table's underlying list of objects.

Overrides: Table.__getitem__
(inherited documentation)

dump(self, out=sys.stdout, row_fn=<built-in function repr>, limit=-1, indent=0)

source code 

Dump out the contents of this table in a nested listing.

Parameters:
  • out - output stream to write to
  • row_fn - function to call to display individual rows
  • limit - number of records to show at deepest level of pivot (-1=show all)
  • indent - current nesting level

dump_counts(self, out=sys.stdout, count_fn=<built-in function len>, colwidth=10)

source code 

Dump out the summary counts of entries in this pivot table as a tabular listing.

Parameters:
  • out - output stream to write to