Skip to content

Commit 11a421d

Browse files
author
Nicholas Ver Halen
committed
Added a test to check uint8 with 0
1 parent 11038f8 commit 11a421d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tools/tests/test_util.py

+8
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,14 @@ def test_downcast(self):
391391
res = pd.to_numeric(data, downcast=downcast)
392392
tm.assert_numpy_array_equal(res, expected)
393393

394+
#check that 0 works as a unsigned downcast
395+
396+
data = [0, 1, 2, 3]
397+
res = pd.to_numeric(data, downcast=downcast)
398+
expected = np.array(data, dtype=np.uint8)
399+
tm.assert_numpy_array_equal(res, expected)
400+
401+
394402
# the smallest integer dtype need not be np.(u)int8
395403
data = ['256', 257, 258]
396404

0 commit comments

Comments
 (0)