Skip to content

CLN: Removed dead GroupBy code #20457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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} """
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -4964,10 +4932,6 @@ def _wrap_aggregated_output(self, output, names=None):
raise com.AbstractMethodError(self)


class NDArrayGroupBy(GroupBy):
pass


# ----------------------------------------------------------------------
# Splitting / application

Expand Down Expand Up @@ -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):
Expand Down