def Dataframe2GSLIB(data_file, df):
    """Convert pandas DataFrame to a GSLIB Geo-EAS file for use with GSLIB
    methods.

    :param data_file: file name
    :param df: dataframe
    :return: None
    """
    ncol = len(df.columns)
    nrow = len(df.index)
    with open(data_file, 'w') as f:
        f.write(data_file + '\n')
        f.write(str(ncol) + '\n')
        for icol in range(ncol):
            f.write(df.columns[icol] + '\n')
        for irow in range(nrow):
            for icol in range(ncol):
                f.write(str(df.iloc[irow, icol]) + ' ')
            f.write('\n')
