@@ -562,7 +562,7 @@ def test_crosstab_with_numpy_size(self):
562
562
codes = [[1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 0 ], [1 , 2 , 3 , 1 , 2 , 3 , 1 , 2 , 3 , 0 ]],
563
563
names = ["A" , "B" ],
564
564
)
565
- expected_column = Index (["bar" , "foo" , "All" ], dtype = "object" , name = "C" )
565
+ expected_column = Index (["bar" , "foo" , "All" ], name = "C" )
566
566
expected_data = np .array (
567
567
[
568
568
[2.0 , 2.0 , 4.0 ],
@@ -670,7 +670,7 @@ def test_crosstab_normalize_multiple_columns(self):
670
670
)
671
671
expected = DataFrame (
672
672
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" ),
674
674
index = MultiIndex .from_tuples (
675
675
[
676
676
("one" , "A" ),
@@ -722,7 +722,7 @@ def test_margin_normalize(self):
722
722
codes = [[1 , 1 , 2 , 2 , 0 ], [1 , 2 , 1 , 2 , 0 ]],
723
723
names = ["A" , "B" ],
724
724
)
725
- expected .columns = Index (["large" , "small" ], dtype = "object" , name = "C" )
725
+ expected .columns = Index (["large" , "small" ], name = "C" )
726
726
tm .assert_frame_equal (result , expected )
727
727
728
728
# normalize on columns
@@ -737,9 +737,7 @@ def test_margin_normalize(self):
737
737
[0 , 0.4 , 0.222222 ],
738
738
]
739
739
)
740
- expected .columns = Index (
741
- ["large" , "small" , "Sub-Total" ], dtype = "object" , name = "C"
742
- )
740
+ expected .columns = Index (["large" , "small" , "Sub-Total" ], name = "C" )
743
741
expected .index = MultiIndex (
744
742
levels = [["bar" , "foo" ], ["one" , "two" ]],
745
743
codes = [[0 , 0 , 1 , 1 ], [0 , 1 , 0 , 1 ]],
@@ -760,9 +758,7 @@ def test_margin_normalize(self):
760
758
[0.444444 , 0.555555 , 1 ],
761
759
]
762
760
)
763
- expected .columns = Index (
764
- ["large" , "small" , "Sub-Total" ], dtype = "object" , name = "C"
765
- )
761
+ expected .columns = Index (["large" , "small" , "Sub-Total" ], name = "C" )
766
762
expected .index = MultiIndex (
767
763
levels = [["Sub-Total" , "bar" , "foo" ], ["" , "one" , "two" ]],
768
764
codes = [[1 , 1 , 2 , 2 , 0 ], [1 , 2 , 1 , 2 , 0 ]],
0 commit comments