Skip to content

Commit 57753d5

Browse files
Chang Shewesm
Chang She
authored andcommitted
BUG: reversed assert condition on a check in frame
1 parent c89e9bb commit 57753d5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5037,12 +5037,8 @@ def group_agg(values, bounds, f):
50375037
result = np.empty((len(bounds), K), dtype=float)
50385038

50395039
testagg = f(values[:min(1, len(values))])
5040-
if isinstance(testagg, np.ndarray):
5041-
raise AssertionError('Results must be an ndarray, not %s'
5042-
% type(testagg))
5043-
if testagg.ndim == 2:
5044-
raise AssertionError('Results must be 2-D, not %d-D'
5045-
% testagg.ndim)
5040+
if isinstance(testagg, np.ndarray) and testagg.ndim == 2:
5041+
raise AssertionError('Function must reduce')
50465042

50475043
for i, left_bound in enumerate(bounds):
50485044
if i == len(bounds) - 1:

0 commit comments

Comments
 (0)