We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a82479a commit aa4b33bCopy full SHA for aa4b33b
pandas/tests/frame/test_apply.py
@@ -116,6 +116,26 @@ def test_apply_with_reduce_empty(self):
116
# Ensure that x.append hasn't been called
117
assert x == []
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
130
131
+ result = df.apply(np.any)
132
+ expected = df.any()
133
134
135
+ result = df.apply(np.all)
136
+ expected = df.all()
137
138
139
def test_apply_deprecate_reduce(self):
140
empty_frame = DataFrame()
141
0 commit comments