Datasets

To aid development, the allopy package houses a few test dataset. The data could be large so they will be downloaded for the first time you request them and saved in your home folder.

Load Index

allopy.datasets.load_index(*, download=False)[source]

Dataset contains the index value of 7 asset classes from 01 Jan 1985 to 01 Oct 2017.

This dataset is usually used only for demonstration purposes. As such, the values have been fudged slightly.

Parameters

download (bool) – If True, forces the data to be downloaded again from the repository. Otherwise, loads the data from the stash folder

Returns

A data frame containing the index of the 7 policy asset classes

Return type

DataFrame

Load Monte Carlo

allopy.datasets.load_monte_carlo(*, download=False, total=False)[source]

Loads a data set containing a mock Monte Carlo simulation of asset class returns.

The Monte Carlo tensor has axis represents time, trials and asset respectively. For the non-total cube, the shape is 80 x 10000 x 9 meaning there are 80 time periods over 10000 trials and 9 asset classes.

The total Monte Carlo tensor’s shape is 60 x 10000 x 36

Parameters
  • download (bool) – If True, forces the data to be downloaded again from the repository. Otherwise, loads the data from the stash folder

  • total (bool) – If True, loads the monte carlo simulation with the total set of asset classes to simulate a big portfolio

Returns

A Monte Carlo tensor

Return type

ndarray