@@ -1131,12 +1131,12 @@ def test_dropna(self):
11311131 )
11321132
11331133 tm .assert_series_equal (
1134- Series ([True , True , False , None ]).value_counts (dropna = True ),
1135- Series ([2 , 1 ], index = [True , False ]),
1134+ Series ([True ] * 3 + [ False ] * 2 + [ None ] * 5 ).value_counts (dropna = True ),
1135+ Series ([3 , 2 ], index = [True , False ]),
11361136 )
11371137 tm .assert_series_equal (
1138- Series ([True , True , False , None ]).value_counts (dropna = False ),
1139- Series ([2 , 1 , 1 ], index = [True , False , np .nan ]),
1138+ Series ([True ] * 5 + [ False ] * 3 + [ None ] * 2 ).value_counts (dropna = False ),
1139+ Series ([5 , 3 , 2 ], index = [True , False , np .nan ]),
11401140 )
11411141 tm .assert_series_equal (
11421142 Series ([10.3 , 5.0 , 5.0 ]).value_counts (dropna = True ),
@@ -1152,26 +1152,24 @@ def test_dropna(self):
11521152 Series ([2 , 1 ], index = [5.0 , 10.3 ]),
11531153 )
11541154
1155- # 32-bit linux has a different ordering
1156- if IS64 :
1157- result = Series ([10.3 , 5.0 , 5.0 , None ]).value_counts (dropna = False )
1158- expected = Series ([2 , 1 , 1 ], index = [5.0 , 10.3 , np .nan ])
1159- tm .assert_series_equal (result , expected )
1155+ result = Series ([10.3 , 10.3 , 5.0 , 5.0 , 5.0 , None ]).value_counts (dropna = False )
1156+ expected = Series ([3 , 2 , 1 ], index = [5.0 , 10.3 , np .nan ])
1157+ tm .assert_series_equal (result , expected )
11601158
11611159 def test_value_counts_normalized (self ):
11621160 # GH12558
1163- s = Series ([1 , 2 , np . nan , np . nan , np .nan ])
1161+ s = Series ([1 ] * 2 + [ 2 ] * 3 + [ np .nan ] * 5 )
11641162 dtypes = (np .float64 , object , "M8[ns]" )
11651163 for t in dtypes :
11661164 s_typed = s .astype (t )
11671165 result = s_typed .value_counts (normalize = True , dropna = False )
11681166 expected = Series (
1169- [0.6 , 0.2 , 0.2 ], index = Series ([np .nan , 2.0 , 1.0 ], dtype = t )
1167+ [0.5 , 0.3 , 0.2 ], index = Series ([np .nan , 2.0 , 1.0 ], dtype = t )
11701168 )
11711169 tm .assert_series_equal (result , expected )
11721170
11731171 result = s_typed .value_counts (normalize = True , dropna = True )
1174- expected = Series ([0.5 , 0.5 ], index = Series ([2.0 , 1.0 ], dtype = t ))
1172+ expected = Series ([0.6 , 0.4 ], index = Series ([2.0 , 1.0 ], dtype = t ))
11751173 tm .assert_series_equal (result , expected )
11761174
11771175 def test_value_counts_uint64 (self ):
0 commit comments