Skip to content

Commit 93452c1

Browse files
committed
TST: alter nonnumeric and float suffix tests in test_melt
1 parent 93a4ccc commit 93452c1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/tests/reshape/test_melt.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,10 @@ def test_nonnumeric_suffix(self):
938938
)
939939
expected = pd.DataFrame(
940940
{
941-
"A": ["X1", "X1", "X2", "X2"],
942-
"colname": ["placebo", "test", "placebo", "test"],
943-
"result": [5.0, np.nan, 6.0, np.nan],
944-
"treatment": [1.0, 3.0, 2.0, 4.0],
941+
"A": ["X1", "X2", "X1", "X2"],
942+
"colname": ["placebo", "placebo", "test", "test"],
943+
"result": [5.0, 6.0, np.nan, np.nan],
944+
"treatment": [1.0, 2.0, 3.0, 4.0],
945945
}
946946
)
947947
expected = expected.set_index(["A", "colname"])
@@ -985,10 +985,10 @@ def test_float_suffix(self):
985985
)
986986
expected = pd.DataFrame(
987987
{
988-
"A": ["X1", "X1", "X1", "X1", "X2", "X2", "X2", "X2"],
989-
"colname": [1, 1.1, 1.2, 2.1, 1, 1.1, 1.2, 2.1],
990-
"result": [0.0, np.nan, 5.0, np.nan, 9.0, np.nan, 6.0, np.nan],
991-
"treatment": [np.nan, 1.0, np.nan, 3.0, np.nan, 2.0, np.nan, 4.0],
988+
"A": ['X1', 'X2', 'X1', 'X2', 'X1', 'X2', 'X1', 'X2'],
989+
"colname": [1.2, 1.2, 1.0, 1.0, 1.1, 1.1, 2.1, 2.1],
990+
"result": [5.0, 6.0, 0.0, 9.0, np.nan, np.nan, np.nan, np.nan],
991+
"treatment": [np.nan, np.nan, np.nan, np.nan, 1.0, 2.0, 3.0, 4.0],
992992
}
993993
)
994994
expected = expected.set_index(["A", "colname"])

0 commit comments

Comments
 (0)