Hierarchical consolidation in Python

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Sep 18 12:30:51 CEST 2014

On 18/09/2014 09:57, ap501228 at gmail.com wrote:
> I am looking for some tips as to how Python could be used to solve a simple business problem involving consolidation of financial data across a company  with a number of business units rolling up to a department and departments rolling up to the whole organization.
> Company = Department(1)+Department(2)+...Department (N)
> Department(1)= Unit(1,1)+Unit(1,2)+...+Unit(1,K)
> ...
> Department(N)= Unit(N,1)+Unit(N,2)+..+Unit(N,K)
> Suppose,for each unit, Unit(i,j) we have a time series of 3 variables:
> Income(i,j) , Expenses(i,j) and Surplus(i,j) = Income(i,j)- Expenses(i,j)
> Required to find:
> (1)Income, Expenses and Surplus consolidated for all units within a Department; and
> (2)Income, Expenses and Surplus consolidated for all departments within the company.
> I would welcome any help in expressing this problem directly in Python. Also, are there any Python modules or packages that enable problems of this type to be solved. Thanks in advance for any help.

Maybe complete overkill here but this animal http://pandas.pydata.org/ 
is worth looking at.  I'll quote "pandas is an open source, BSD-licensed 
library providing high-performance, easy-to-use data structures and data 
analysis tools for the Python programming language.".

My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

More information about the Python-list mailing list