(frame, ordered=False)
Convert a pandas DataFrame to a dictionary that will survive
    YAML serialization and re-conversion back to a DataFrame.

    Parameters
    ----------
    frame : pandas.DataFrame
    ordered: bool, optional, default False
        If True, an OrderedDict is returned.

    Returns
    -------
    safe : dict or OrderedDict
Convert a pandas DataFrame to a dictionary that will survive
    YAML serialization and re-conversion back to a DataFrame.
Convert a pandas DataFrame to a dictionary that will survive YAML serialization and re - conversion back to a DataFrame .
def frame_to_yaml_safe(frame, ordered=False):
    """
    Convert a pandas DataFrame to a dictionary that will survive
    YAML serialization and re-conversion back to a DataFrame.

    Parameters
    ----------
    frame : pandas.DataFrame
    ordered: bool, optional, default False
        If True, an OrderedDict is returned.

    Returns
    -------
    safe : dict or OrderedDict

    """
    if ordered:
        return OrderedDict(tuple((col, series_to_yaml_safe(series, True))
                                 for col, series in frame.iteritems()))
    else:
        return {col: series_to_yaml_safe(series)
                for col, series in frame.iteritems()}
def frame_to_yaml_safe ( frame , ordered = False ) : if ordered : return OrderedDict ( tuple ( ( col , series_to_yaml_safe ( series , True ) ) for col , series in frame . iteritems ( ) ) ) else : return { col : series_to_yaml_safe ( series ) for col , series in frame . iteritems ( ) }