Skip to content

Commit b7e96fe

Browse files
committed
Fix some tests
1 parent d68c79f commit b7e96fe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pandas/tests/frame/indexing/test_indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def test_single_element_ix_dont_upcast(self, float_frame):
10051005
result = df.loc[0, "b"]
10061006
assert is_integer(result)
10071007

1008-
expected = Series([666], [0], name="b")
1008+
expected = Series([666], index=range(1), name="b")
10091009
result = df.loc[[0], "b"]
10101010
tm.assert_series_equal(result, expected)
10111011

@@ -1470,7 +1470,7 @@ def test_iloc_ea_series_indexer(self):
14701470
indexer = Series([0, 1], dtype="Int64")
14711471
row_indexer = Series([1], dtype="Int64")
14721472
result = df.iloc[row_indexer, indexer]
1473-
expected = DataFrame([[5, 6]], index=[1])
1473+
expected = DataFrame([[5, 6]], index=range(1, 2))
14741474
tm.assert_frame_equal(result, expected)
14751475

14761476
result = df.iloc[row_indexer.values, indexer.values]

pandas/tests/tools/test_to_datetime.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,6 +1968,7 @@ def test_dataframe(self, df, cache):
19681968

19691969
# dict-like
19701970
result = to_datetime(df[["year", "month", "day"]].to_dict(), cache=cache)
1971+
expected.index = Index([0, 1])
19711972
tm.assert_series_equal(result, expected)
19721973

19731974
def test_dataframe_dict_with_constructable(self, df, cache):
@@ -1976,7 +1977,8 @@ def test_dataframe_dict_with_constructable(self, df, cache):
19761977
df2["month"] = 2
19771978
result = to_datetime(df2, cache=cache)
19781979
expected2 = Series(
1979-
[Timestamp("20150204 00:00:00"), Timestamp("20160205 00:0:00")]
1980+
[Timestamp("20150204 00:00:00"), Timestamp("20160205 00:0:00")],
1981+
index=Index([0, 1]),
19801982
)
19811983
tm.assert_series_equal(result, expected2)
19821984

0 commit comments

Comments
 (0)