@@ -74,8 +74,10 @@ def test_apply_mixed_datetimelike(self):
74
74
result = df .apply (lambda x : x , axis = 1 )
75
75
assert_frame_equal (result , df )
76
76
77
- def test_apply_empty (self , float_frame , empty_frame ):
77
+ def test_apply_empty (self , float_frame ):
78
78
# empty
79
+ empty_frame = DataFrame ()
80
+
79
81
applied = empty_frame .apply (np .sqrt )
80
82
assert applied .empty
81
83
@@ -97,8 +99,10 @@ def test_apply_empty(self, float_frame, empty_frame):
97
99
result = expected .apply (lambda x : x ['a' ], axis = 1 )
98
100
assert_frame_equal (expected , result )
99
101
100
- def test_apply_with_reduce_empty (self , empty_frame ):
102
+ def test_apply_with_reduce_empty (self ):
101
103
# reduce with an empty DataFrame
104
+ empty_frame = DataFrame ()
105
+
102
106
x = []
103
107
result = empty_frame .apply (x .append , axis = 1 , result_type = 'expand' )
104
108
assert_frame_equal (result , empty_frame )
@@ -116,7 +120,9 @@ def test_apply_with_reduce_empty(self, empty_frame):
116
120
# Ensure that x.append hasn't been called
117
121
assert x == []
118
122
119
- def test_apply_deprecate_reduce (self , empty_frame ):
123
+ def test_apply_deprecate_reduce (self ):
124
+ empty_frame = DataFrame ()
125
+
120
126
x = []
121
127
with tm .assert_produces_warning (FutureWarning ):
122
128
empty_frame .apply (x .append , axis = 1 , reduce = True )
0 commit comments