diff --git a/ggplot/ggplot.py b/ggplot/ggplot.py index ba12a6bd..91d31629 100755 --- a/ggplot/ggplot.py +++ b/ggplot/ggplot.py @@ -599,7 +599,10 @@ def _prep_layer_for_plotting(self, layer, facetgroup): if 'fill' in self._aes: fillcol_raw = self._aes['fill'][:-5] fillcol = self._aes['fill'] - fill_levels = self.data[[fillcol_raw, fillcol]].sort(fillcol_raw)[fillcol].unique() + try: # change in Pandas-0.19 + fill_levels = self.data[[fillcol_raw, fillcol]].sort_values(by=fillcol_raw)[fillcol].unique() + except: # before Pandas-0.19 + fill_levels = self.data[[fillcol_raw, fillcol]].sort(fillcol_raw)[fillcol].unique() else: fill_levels = None return dict(x_levels=self.data[self._aes['x']].unique(), fill_levels=fill_levels, lookups=df)