Skip to content

Commit 21502e7

Browse files
committed
update tests
1 parent dc77628 commit 21502e7

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

pandas/tests/frame/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def test_constructor_invalid_items_unused(self, scalar):
565565
expected = DataFrame(columns=["b"])
566566
tm.assert_frame_equal(result, expected)
567567

568-
@pytest.mark.parametrize("value", [2, np.nan, None, float("nan")])
568+
@pytest.mark.parametrize("value", [4, np.nan, None, float("nan")])
569569
def test_constructor_dict_nan_key(self, value):
570570
# GH 18455
571571
cols = [1, value, 3]

pandas/tests/frame/test_reductions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,33 +1184,33 @@ def test_idxmax_mixed_dtype(self):
11841184
df = DataFrame({1: [0, 2, 1], 2: range(3)[::-1], 3: dti})
11851185

11861186
result = df.idxmax()
1187-
expected = Series([1, 0, 2], index=[1, 2, 3])
1187+
expected = Series([1, 0, 2], index=range(1, 4))
11881188
tm.assert_series_equal(result, expected)
11891189

11901190
result = df.idxmin()
1191-
expected = Series([0, 2, 0], index=[1, 2, 3])
1191+
expected = Series([0, 2, 0], index=range(1, 4))
11921192
tm.assert_series_equal(result, expected)
11931193

11941194
# with NaTs
11951195
df.loc[0, 3] = pd.NaT
11961196
result = df.idxmax()
1197-
expected = Series([1, 0, 2], index=[1, 2, 3])
1197+
expected = Series([1, 0, 2], index=range(1, 4))
11981198
tm.assert_series_equal(result, expected)
11991199

12001200
result = df.idxmin()
1201-
expected = Series([0, 2, 1], index=[1, 2, 3])
1201+
expected = Series([0, 2, 1], index=range(1, 4))
12021202
tm.assert_series_equal(result, expected)
12031203

12041204
# with multi-column dt64 block
12051205
df[4] = dti[::-1]
12061206
df._consolidate_inplace()
12071207

12081208
result = df.idxmax()
1209-
expected = Series([1, 0, 2, 0], index=[1, 2, 3, 4])
1209+
expected = Series([1, 0, 2, 0], index=range(1, 5))
12101210
tm.assert_series_equal(result, expected)
12111211

12121212
result = df.idxmin()
1213-
expected = Series([0, 2, 1, 2], index=[1, 2, 3, 4])
1213+
expected = Series([0, 2, 1, 2], index=range(1, 5))
12141214
tm.assert_series_equal(result, expected)
12151215

12161216
@pytest.mark.parametrize(
@@ -1833,7 +1833,7 @@ def test_df_empty_min_count_0(self, opname, dtype, exp_value, exp_dtype):
18331833
df = DataFrame({0: [], 1: []}, dtype=dtype)
18341834
result = getattr(df, opname)(min_count=0)
18351835

1836-
expected = Series([exp_value, exp_value], dtype=exp_dtype, index=Index([0, 1]))
1836+
expected = Series([exp_value, exp_value], dtype=exp_dtype, index=range(2))
18371837
tm.assert_series_equal(result, expected)
18381838

18391839
@pytest.mark.parametrize(

pandas/tests/io/excel/test_readers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,6 @@ def test_read_excel_multiindex(self, request, engine, read_ext):
10341034
[4, 5.5, pd.Timestamp("2015-01-04"), True],
10351035
],
10361036
columns=mi,
1037-
index=Index([0, 1, 2, 3], dtype="int64"),
10381037
)
10391038
expected[mi[2]] = expected[mi[2]].astype(f"M8[{unit}]")
10401039

@@ -1066,7 +1065,7 @@ def test_read_excel_multiindex(self, request, engine, read_ext):
10661065
tm.assert_frame_equal(actual, expected)
10671066

10681067
# "mi_column_name" sheet
1069-
expected.index = list(range(4))
1068+
expected.index = range(4)
10701069
expected.columns = mi.set_names(["c1", "c2"])
10711070
actual = pd.read_excel(
10721071
mi_file, sheet_name="mi_column_name", header=[0, 1], index_col=0

0 commit comments

Comments
 (0)