Skip to content

Commit e38804d

Browse files
committed
Revert commit
1 parent 0176228 commit e38804d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/tests/apply/test_frame_apply.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ def test_consistency_for_boxed(self, box, int_frame_const_col):
11011101

11021102
class TestDataFrameAggregate:
11031103
def test_agg_transform(self, axis, float_frame):
1104+
float_frame = float_frame.head()
11041105
other_axis = 1 if axis in {0, "index"} else 0
11051106

11061107
with np.errstate(all="ignore"):
@@ -1124,11 +1125,16 @@ def test_agg_transform(self, axis, float_frame):
11241125
expected.index = pd.MultiIndex.from_product(
11251126
[float_frame.index, ["sqrt"]]
11261127
)
1128+
print("result")
1129+
print(result)
1130+
print("expected")
1131+
print(expected)
11271132
tm.assert_frame_equal(result, expected)
11281133

11291134
# multiple items in list
11301135
# these are in the order as if we are applying both
11311136
# functions per series and then concatting
1137+
print("marker")
11321138
result = float_frame.apply([np.abs, np.sqrt], axis=axis)
11331139
expected = zip_frames([f_abs, f_sqrt], axis=other_axis)
11341140
if axis in {0, "index"}:
@@ -1139,20 +1145,24 @@ def test_agg_transform(self, axis, float_frame):
11391145
expected.index = pd.MultiIndex.from_product(
11401146
[float_frame.index, ["absolute", "sqrt"]]
11411147
)
1148+
print()
1149+
print(result)
1150+
print()
1151+
print(expected)
11421152
tm.assert_frame_equal(result, expected)
11431153

11441154
def test_transform_and_agg_err(self, axis, float_frame):
11451155
# cannot both transform and agg
11461156
msg = "cannot combine transform and aggregation operations"
11471157
with pytest.raises(ValueError, match=msg):
11481158
with np.errstate(all="ignore"):
1149-
float_frame.agg(["max", "sqrt"], axis=axis)
1159+
print(float_frame.agg(["max", "sqrt"], axis=axis))
11501160

11511161
df = DataFrame({"A": range(5), "B": 5})
11521162

11531163
def f():
11541164
with np.errstate(all="ignore"):
1155-
df.agg({"A": ["abs", "sum"], "B": ["mean", "max"]}, axis=axis)
1165+
print(df.agg({"A": ["abs", "sum"], "B": ["mean", "max"]}, axis=axis))
11561166

11571167
def test_demo(self):
11581168
# demonstration tests

0 commit comments

Comments
 (0)