Skip to content

Commit cfeafd9

Browse files
WillAydyhaque1213
authored andcommitted
Cleanup of GroupBy Code (pandas-dev#26090)
1 parent 3b68936 commit cfeafd9

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

pandas/core/groupby/generic.py

-34
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,6 @@ def _cython_agg_general(self, how, alt=None, numeric_only=True,
6868
how, alt=alt, numeric_only=numeric_only, min_count=min_count)
6969
return self._wrap_agged_blocks(new_items, new_blocks)
7070

71-
def _wrap_agged_blocks(self, items, blocks):
72-
obj = self._obj_with_exclusions
73-
74-
new_axes = list(obj._data.axes)
75-
76-
# more kludge
77-
if self.axis == 0:
78-
new_axes[0], new_axes[1] = new_axes[1], self.grouper.result_index
79-
else:
80-
new_axes[self.axis] = self.grouper.result_index
81-
82-
# Make sure block manager integrity check passes.
83-
assert new_axes[0].equals(items)
84-
new_axes[0] = items
85-
86-
mgr = BlockManager(blocks, new_axes)
87-
88-
new_obj = type(obj)(mgr)
89-
90-
return self._post_process_cython_aggregate(new_obj)
91-
9271
_block_agg_axis = 0
9372

9473
def _cython_agg_blocks(self, how, alt=None, numeric_only=True,
@@ -165,19 +144,6 @@ def _cython_agg_blocks(self, how, alt=None, numeric_only=True,
165144

166145
return new_items, new_blocks
167146

168-
def _get_data_to_aggregate(self):
169-
obj = self._obj_with_exclusions
170-
if self.axis == 0:
171-
return obj.swapaxes(0, 1)._data, 1
172-
else:
173-
return obj._data, self.axis
174-
175-
def _post_process_cython_aggregate(self, obj):
176-
# undoing kludge from below
177-
if self.axis == 0:
178-
obj = obj.swapaxes(0, 1)
179-
return obj
180-
181147
def aggregate(self, arg, *args, **kwargs):
182148

183149
_level = kwargs.pop('_level', None)

0 commit comments

Comments
 (0)