Writes the index to file.

    Args:
        fn (str): the name of the file that will contain the index.
        index (pandas.DataFrame): the index.

def write_index(fn, index):
    """Writes the index to file.

    Args:
        fn (str): the name of the file that will contain the index.
        index (pandas.DataFrame): the index.

    """
    with open(fn, "wb") as o_file:
        o_file.write(_CHECK_STRING)
        o_file.write(zlib.compress(bytes(
            index.to_csv(None, index=False, encoding="utf-8"),
            encoding="utf-8",
        )))