Skip to content

Commit e723d0f

Browse files
phoflcbpygit
authored andcommitted
Adjust crosstab tests for new string option (pandas-dev#56526)
1 parent 1b9e6e4 commit e723d0f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pandas/tests/reshape/test_crosstab.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def test_crosstab_with_numpy_size(self):
562562
codes=[[1, 1, 1, 2, 2, 2, 3, 3, 3, 0], [1, 2, 3, 1, 2, 3, 1, 2, 3, 0]],
563563
names=["A", "B"],
564564
)
565-
expected_column = Index(["bar", "foo", "All"], dtype="object", name="C")
565+
expected_column = Index(["bar", "foo", "All"], name="C")
566566
expected_data = np.array(
567567
[
568568
[2.0, 2.0, 4.0],
@@ -670,7 +670,7 @@ def test_crosstab_normalize_multiple_columns(self):
670670
)
671671
expected = DataFrame(
672672
np.array([0] * 29 + [1], dtype=float).reshape(10, 3),
673-
columns=Index(["bar", "foo", "All"], dtype="object", name="C"),
673+
columns=Index(["bar", "foo", "All"], name="C"),
674674
index=MultiIndex.from_tuples(
675675
[
676676
("one", "A"),
@@ -722,7 +722,7 @@ def test_margin_normalize(self):
722722
codes=[[1, 1, 2, 2, 0], [1, 2, 1, 2, 0]],
723723
names=["A", "B"],
724724
)
725-
expected.columns = Index(["large", "small"], dtype="object", name="C")
725+
expected.columns = Index(["large", "small"], name="C")
726726
tm.assert_frame_equal(result, expected)
727727

728728
# normalize on columns
@@ -737,9 +737,7 @@ def test_margin_normalize(self):
737737
[0, 0.4, 0.222222],
738738
]
739739
)
740-
expected.columns = Index(
741-
["large", "small", "Sub-Total"], dtype="object", name="C"
742-
)
740+
expected.columns = Index(["large", "small", "Sub-Total"], name="C")
743741
expected.index = MultiIndex(
744742
levels=[["bar", "foo"], ["one", "two"]],
745743
codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
@@ -760,9 +758,7 @@ def test_margin_normalize(self):
760758
[0.444444, 0.555555, 1],
761759
]
762760
)
763-
expected.columns = Index(
764-
["large", "small", "Sub-Total"], dtype="object", name="C"
765-
)
761+
expected.columns = Index(["large", "small", "Sub-Total"], name="C")
766762
expected.index = MultiIndex(
767763
levels=[["Sub-Total", "bar", "foo"], ["", "one", "two"]],
768764
codes=[[1, 1, 2, 2, 0], [1, 2, 1, 2, 0]],

0 commit comments

Comments
 (0)