File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,26 @@ def test_apply_with_reduce_empty(self):
116
116
# Ensure that x.append hasn't been called
117
117
assert x == []
118
118
119
+ def test_apply_funcs_over_empty (self ):
120
+ # GH 28213
121
+ df = DataFrame (columns = ["a" , "b" , "c" ])
122
+
123
+ result = df .apply (np .sum )
124
+ expected = df .sum ()
125
+ assert_series_equal (result , expected )
126
+
127
+ result = df .apply (np .prod )
128
+ expected = df .prod ()
129
+ assert_series_equal (result , expected )
130
+
131
+ result = df .apply (np .any )
132
+ expected = df .any ()
133
+ assert_series_equal (result , expected )
134
+
135
+ result = df .apply (np .all )
136
+ expected = df .all ()
137
+ assert_series_equal (result , expected )
138
+
119
139
def test_apply_deprecate_reduce (self ):
120
140
empty_frame = DataFrame ()
121
141
You can’t perform that action at this time.
0 commit comments