code: def write_index(fn, 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",
          )))
docs: Writes the index to file.
  
      Args:
          fn (str): the name of the file that will contain the index.
          index (pandas.DataFrame): the index.