Skip to content

Commit 6b9c459

Browse files
committed
Adjust more tests
1 parent 95d10ae commit 6b9c459

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/tests/apply/test_frame_apply.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,18 @@ def test_apply_mixed_dtype_corner():
324324
result = df[:0].apply(np.mean, axis=1)
325325
# the result here is actually kind of ambiguous, should it be a Series
326326
# or a DataFrame?
327-
expected = Series(np.nan, index=pd.Index([], dtype="int64"))
327+
expected = Series(dtype=np.float64)
328328
tm.assert_series_equal(result, expected)
329329

330330

331331
def test_apply_mixed_dtype_corner_indexing():
332332
df = DataFrame({"A": ["foo"], "B": [1.0]})
333333
result = df.apply(lambda x: x["A"], axis=1)
334-
expected = Series(["foo"], index=[0])
334+
expected = Series(["foo"], index=range(1))
335335
tm.assert_series_equal(result, expected)
336336

337337
result = df.apply(lambda x: x["B"], axis=1)
338-
expected = Series([1.0], index=[0])
338+
expected = Series([1.0], index=range(1))
339339
tm.assert_series_equal(result, expected)
340340

341341

@@ -993,7 +993,7 @@ def test_result_type(int_frame_const_col):
993993

994994
result = df.apply(lambda x: [1, 2, 3], axis=1, result_type="expand")
995995
expected = df.copy()
996-
expected.columns = [0, 1, 2]
996+
expected.columns = range(3)
997997
tm.assert_frame_equal(result, expected)
998998

999999

@@ -1003,7 +1003,7 @@ def test_result_type_shorter_list(int_frame_const_col):
10031003
df = int_frame_const_col
10041004
result = df.apply(lambda x: [1, 2], axis=1, result_type="expand")
10051005
expected = df[["A", "B"]].copy()
1006-
expected.columns = [0, 1]
1006+
expected.columns = range(2)
10071007
tm.assert_frame_equal(result, expected)
10081008

10091009

0 commit comments

Comments
 (0)