tsa.register_formula_bindings#
- mainsource.register_formula_bindings(groupname, formulaname, bindings)#
Define a group by association of an existing series formula and a bindings object.
The designated series formula will be then interpreted as a group formula.
And the bindings object provides mappings that tell which components of the formula are to be interpreted as groups.
Given a formula named “form1”:
(add (series "foo") (series "bar") (series "quux"))
… where one wants to treat “foo” and “bar” as groups. The binding is expressed as a dataframe:
binding = pd.DataFrame( [ ['foo', 'foo-group', 'group'], ['bar', 'bar-group', 'group'], ], columns=('series', 'group', 'family') )
The complete registration looks like:
register_formula_bindings( 'groupname', 'form1', pd.DataFrame( [ ['foo', 'foo-group', 'group'], ['bar', 'bar-group', 'group'], ], columns=('series', 'group', 'family') ))
Within a given family, all groups must have the same number of members (series) and the member roles are considered equivalent (e.g. meteorological scenarios).
- Parameters:
groupname (str)
formulaname (str)
bindings (DataFrame)
- Return type:
None