'Create a ``dict`` of columns from a Pandas DataFrame,
suitable for creating a ColumnDataSource.
Args:
df (DataFrame) : data to convert
Returns:
dict[str, np.array]'

@staticmethod
def _data_from_df(df):

    _df = df.copy()
    index = _df.index
    tmp_data = _df.to_dict('series')
    new_data = {}
    for (k, v) in tmp_data.items():
        if isinstance(k, tuple):
            k = '_'.join(k)
        new_data[k] = v
    if index.name:
        new_data[index.name] = index.values
    elif index.names:
        try:
            new_data['_'.join(index.names)] = index.values
        except TypeError:
            new_data['index'] = index.values
    else:
        new_data['index'] = index.values
    return new_data
