From e07bb85842bc4eea03d1a9967fb71b44209e2f29 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 22 Mar 2018 11:28:39 -0700 Subject: [PATCH] Removed dead groupby code --- pandas/core/groupby.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 4352a001aa989..7b68ad67675ff 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -944,23 +944,6 @@ def _cumcount_array(self, ascending=True): rev[sorter] = np.arange(count, dtype=np.intp) return out[rev].astype(np.int64, copy=False) - def _index_with_as_index(self, b): - """ - Take boolean mask of index to be returned from apply, if as_index=True - - """ - # TODO perf, it feels like this should already be somewhere... - from itertools import chain - original = self._selected_obj.index - gp = self.grouper - levels = chain((gp.levels[i][gp.labels[i][b]] - for i in range(len(gp.groupings))), - (original._get_level_values(i)[b] - for i in range(original.nlevels))) - new = MultiIndex.from_arrays(list(levels)) - new.names = gp.names + original.names - return new - def _try_cast(self, result, obj, numeric_only=False): """ try to cast the result to our obj original type, @@ -2295,18 +2278,6 @@ def size(self): index=self.result_index, dtype='int64') - @cache_readonly - def _max_groupsize(self): - """ - Compute size of largest group - """ - # For many items in each group this is much faster than - # self.size().max(), in worst case marginally slower - if self.indices: - return max(len(v) for v in self.indices.values()) - else: - return 0 - @cache_readonly def groups(self): """ dict {group name -> group labels} """ @@ -2941,9 +2912,6 @@ def __init__(self, index, grouper=None, obj=None, name=None, level=None, if isinstance(grouper, MultiIndex): self.grouper = grouper.values - # pre-computed - self._should_compress = True - # we have a single grouper which may be a myriad of things, # some of which are dependent on the passing in level @@ -4964,10 +4932,6 @@ def _wrap_aggregated_output(self, output, names=None): raise com.AbstractMethodError(self) -class NDArrayGroupBy(GroupBy): - pass - - # ---------------------------------------------------------------------- # Splitting / application @@ -5020,10 +4984,6 @@ def apply(self, f): raise com.AbstractMethodError(self) -class ArraySplitter(DataSplitter): - pass - - class SeriesSplitter(DataSplitter): def _chop(self, sdata, slice_obj):