def df2dict(df):
    """
    Return a dictionary from a Pandas.dataframe.

    :param pandas.DataFrame df:
        Pandas' DataFrame.

    :return: dict.
    """
    df_dict = df.to_dict('split')
    return {df_dict['index'][x]: df_dict['data'][x] for x in range(len(df_dict['index']))}