import io


def get_df_as_file(df, float_format='%.f'):
    """ Returns a string buffer of the dataframe """
    string_buffer = io.StringIO()
    df.to_csv(
        string_buffer,
        sep='\t',
        na_rep='Unknown',
        index=False,
        header=False,
        float_format=float_format
    )

    string_buffer.seek(0)
    return string_buffer