Git Product home page Git Product logo

precon's Introduction

precon: Python functions for Price Index production

What is it?

precon is a Python package that provides a suite of speedy, vectorised functions for implementing common methods in the production of Price Indices. It aims to provide the high-level building blocks for building statistical systems at National Statistical Institutes (NSIs) and other research institutions concerned with creating indices. It has been developed in-house at the Office for National Statistics (ONS) and aims to become the standard library for price index production. This can only be achieved with help from the community, so all contributions are welcome!

Installation

pip install precon

Use

import precon

API

Many functions in the precon package are designed to work with pandas DataFrames or Series that contain only one type of value, with any categorical or descriptive metadata contained within either the index or columns axis. Each component of a statistical operation or equation will usually be within it's own DataFrame, i.e. prices in one Frame and weights in another. When dealing with time series data, the functions expect one axis to contain only the datetime index. Where a function accepts more than one input DataFrame, they will need to share the same index values so that pandas can match up the components that the programmer wants to process together. Processing values using this matrix format approach allows the functions to take advantage of powerful pandas/numpy vectorised methods.

It is not always necessary that the time series period frequencies match up if the values in one DataFrame do not change over the given period frequency in another DataFrame, as the functions will resample to the smaller period frequency and fill forward the values.

Check the docs for detailed guidance on each function and its parameters.

Features

  • Calculate fixed-base price indices using common index methods.
  • Combine or aggregate lower-level indices to create higher-level indices.
  • Chain fixed-base indices together for a continuous time series.
  • Re-reference indices to start from a different time period.
  • Calculate contributions to higher-level indices from each of the component indices.
  • Impute new base prices over a time series.
  • Uprating values by index movements.
  • Rounding weight values with adjustment to ensure the sum doesn't change.
  • Stat compiler functions to quickly produce common sets of statistics.

Dependencies

Contributing to precon

See CONTRIBUTING.rst

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.