def _write_core_tables(options, module, core_results):
    """
    Notes
    -----
    Depending on function that was called for analysis, core_results may be a
    list of tuples (empirical), a dataframe, an array, or a single value.

    For the list of tuples from empirical, the second element of each tuple is
    the raw result, and we write them all with the appropriate prefix. For
    dataframes, we write them. For arrays or single values, we convert to data
    frames and write them.

    """

    table_name = 'core_result.csv'
    single_file_path = os.path.join(options['run_dir'], table_name)

    if module == 'emp':  # List of tuples
        for i, core_result in enumerate(core_results):
            file_path = _get_file_path(i, options, table_name)
            core_result[1].to_csv(file_path, index=False, float_format='%.4f')

    elif type(core_results) == type(pd.DataFrame()):  # DataFrame
        core_results.to_csv(single_file_path, index=False, float_format='%.4f')

    else:  # Array or single value (atleast_1d corrects for unsized array)
        df = pd.DataFrame({'y': np.atleast_1d(core_results)})
        df.to_csv(single_file_path, index=False, float_format='%.4f')
Notes
    -----
    Depending on function that was called for analysis, core_results may be a
    list of tuples (empirical), a dataframe, an array, or a single value.

    For the list of tuples from empirical, the second element of each tuple is
    the raw result, and we write them all with the appropriate prefix. For
    dataframes, we write them. For arrays or single values, we convert to data
    frames and write them.