File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -924,3 +924,4 @@ Bug Fixes
924
924
- Bug in ``pd.melt()`` where passing a tuple value for ``value_vars`` caused a ``TypeError`` (:issue:`15348`)
925
925
- Bug in ``.eval()`` which caused multiline evals to fail with local variables not on the first line (:issue:`15342`)
926
926
- Bug in ``pd.read_msgpack`` which did not allow to load dataframe with an index of type ``CategoricalIndex`` (:issue:`15487`)
927
+ - Bug in ``.mode()`` where ``mode`` was not returned for a single value (:issue:`15714`)
Original file line number Diff line number Diff line change @@ -1261,11 +1261,18 @@ def test_mode_single(self):
1261
1261
exp_single = [1 ]
1262
1262
data_single = [1 ]
1263
1263
1264
+ exp_multi = [1 ]
1265
+ data_multi = [1 , 1 ]
1266
+
1264
1267
for dt in np .typecodes ['AllInteger' ] + np .typecodes ['Float' ]:
1265
1268
s = Series (data_single , dtype = dt )
1266
1269
exp = Series (exp_single , dtype = dt )
1267
1270
tm .assert_series_equal (algos .mode (s ), exp )
1268
1271
1272
+ s = Series (data_multi , dtype = dt )
1273
+ exp = Series (exp_multi , dtype = dt )
1274
+ tm .assert_series_equal (algos .mode (s ), exp )
1275
+
1269
1276
exp = Series ([1 ], dtype = np .int )
1270
1277
tm .assert_series_equal (algos .mode ([1 ]), exp )
1271
1278
You can’t perform that action at this time.
0 commit comments