Skip to content

Commit dc5255f

Browse files
committed
Transform Pandas Columns CategoricalIndex in list
bokeh#8420 pandas-dev/pandas#19136
1 parent ee80370 commit dc5255f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bokeh/models/sources.py

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def _data_from_df(df):
172172
except TypeError:
173173
raise TypeError('Could not flatten MultiIndex columns. '
174174
'use string column names or flatten manually')
175+
# Transform columns CategoricalIndex in list
176+
if isinstance(df.columns, pd.CategoricalIndex):
177+
_df.columns = df.columns.tolist()
175178
# Flatten index
176179
index_name = ColumnDataSource._df_index_name(df)
177180
if index_name == 'index':

0 commit comments

Comments
 (0)