@@ -204,17 +204,6 @@ def compute_panel(cls, data, scales, **params):
204
204
params ['fun_ymin' ], params ['fun_ymax' ],
205
205
params ['fun_args' ])
206
206
207
- # NOTE: This is a temporary fix due to bug
208
- # https://github.com/pydata/pandas/issues/10409
209
- # Remove when that bug is fixed
210
- import pandas .api .types as pdtypes
211
-
212
- def preserve_categories (ref , other ):
213
- for col in ref .columns & other .columns :
214
- if pdtypes .is_categorical_dtype (ref [col ]):
215
- other [col ] = other [col ].astype (
216
- 'category' , categories = ref [col ].cat .categories )
217
-
218
207
# break a dataframe into pieces, summarise each piece,
219
208
# and join the pieces back together, retaining original
220
209
# columns unaffected by the summary.
@@ -227,7 +216,6 @@ def preserve_categories(ref, other):
227
216
if 'y' in unique :
228
217
unique = unique .drop ('y' , axis = 1 )
229
218
merged = summary .merge (unique , on = ['group' , 'x' ])
230
- preserve_categories (unique , merged ) # see above note
231
219
summaries .append (merged )
232
220
233
221
new_data = pd .concat (summaries , axis = 0 , ignore_index = True )
0 commit comments