# *******************************************************
#   Mosel Example Problems
#   ======================
#
#   file folioqp_py.py
#   ``````````````````
#   Python function definitions for Mosel master model
#   folioqp_py.mos.
#
#   (c) 2018 Fair Isaac Corporation
#       author: J. Müller, April 2018
# *******************************************************
import pandas as pd


def covariance_of_series(series):
    """ Compute covariance matrix of two-dimensional series. """

    covariance_data_frame = series.unstack(level = 0).cov()
    print(covariance_data_frame)

    return covariance_data_frame.stack()
