Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Jun 27, 2019
1 parent 7a773d8 commit 9b551dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _cython_agg_blocks(self, how, alt=None, numeric_only=True,
s = groupby(obj, self.grouper)
try:
result = s.aggregate(lambda x: alt(x, axis=self.axis))
except Exception:
except TypeError:
# we may have an exception in trying to aggregate
# continue and exclude the block
pass
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/sparse/test_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def test_pivot_table(self):
values='E', aggfunc='mean')
tm.assert_frame_equal(res_sparse, res_dense)

# ToDo: sum doesn't handle nan properly
# res_sparse = pd.pivot_table(self.sparse, index='A', columns='B',
# values='E', aggfunc='sum')
# res_dense = pd.pivot_table(self.dense, index='A', columns='B',
# values='E', aggfunc='sum')
# tm.assert_frame_equal(res_sparse, res_dense)
def test_pivot_table_with_nans(self):
res_sparse = pd.pivot_table(self.sparse, index='A', columns='B',
values='E', aggfunc='sum')
res_dense = pd.pivot_table(self.dense, index='A', columns='B',
values='E', aggfunc='sum')
tm.assert_frame_equal(res_sparse, res_dense)

@pytest.mark.xfail(not _np_version_under1p17,
reason="failing occasionally on numpy > 1.17",
Expand Down

0 comments on commit 9b551dd

Please sign in to comment.