Cluster

class quantipy.Cluster(name='')

Container class in form of an OrderedDict of Chains.

It is possible to interact with individual Chains through the Cluster object. Clusters are mainly used to prepare aggregations for an export/ build, e.g. MS Excel Workbooks.

add_chain(chains=None)

Adds chains to a cluster

bank_chains(spec, text_key)

Return a banked chain as defined by spec.

This method returns a banked or compound chain where the spec describes how the view results from multiple chains should be banked together into the same set of dataframes in a single chain.

Parameters:
  • spec (dict) – The banked chain specification object.
  • text_key (str, default='values') – Paint the x-axis of the banked chain using the spec provided and this text_key.
Returns:

bchain – The banked chain.

Return type:

quantipy.Chain

static load(path_cluster)

Load Stack instance from .stack file.

Parameters:path_cluster (str) – The full path to the .cluster file that should be created, including the extension.
Returns:
Return type:None
merge()

Merges all Chains found in the Cluster into a new pandas.DataFrame.

save(path_cluster)

Load Stack instance from .stack file.

Parameters:path_cluster (str) – The full path to the .cluster file that should be created, including the extension.
Returns:
Return type:None