@@ -180,6 +180,15 @@ def test_scalar_float(self):
180
180
x_rec = self .encode_decode (x )
181
181
tm .assert_almost_equal (x , x_rec )
182
182
183
+ def test_scalar_bool (self ):
184
+ x = np .bool_ (1 )
185
+ x_rec = self .encode_decode (x )
186
+ tm .assert_almost_equal (x , x_rec )
187
+
188
+ x = np .bool_ (0 )
189
+ x_rec = self .encode_decode (x )
190
+ tm .assert_almost_equal (x , x_rec )
191
+
183
192
def test_scalar_complex (self ):
184
193
x = np .random .rand () + 1j * np .random .rand ()
185
194
x_rec = self .encode_decode (x )
@@ -263,7 +272,7 @@ def test_numpy_array_complex(self):
263
272
x .dtype == x_rec .dtype )
264
273
265
274
def test_list_mixed (self ):
266
- x = [1.0 , np .float32 (3.5 ), np .complex128 (4.25 ), u ('foo' )]
275
+ x = [1.0 , np .float32 (3.5 ), np .complex128 (4.25 ), u ('foo' ), np . bool_ ( 1 ) ]
267
276
x_rec = self .encode_decode (x )
268
277
# current msgpack cannot distinguish list/tuple
269
278
tm .assert_almost_equal (tuple (x ), x_rec )
@@ -401,6 +410,7 @@ def setup_method(self, method):
401
410
'G' : [Timestamp ('20130102' , tz = 'US/Eastern' )] * 5 ,
402
411
'H' : Categorical ([1 , 2 , 3 , 4 , 5 ]),
403
412
'I' : Categorical ([1 , 2 , 3 , 4 , 5 ], ordered = True ),
413
+ 'J' : (np .bool_ (1 ), 2 , 3 , 4 , 5 ),
404
414
}
405
415
406
416
self .d ['float' ] = Series (data ['A' ])
@@ -410,6 +420,7 @@ def setup_method(self, method):
410
420
self .d ['dt_tz' ] = Series (data ['G' ])
411
421
self .d ['cat_ordered' ] = Series (data ['H' ])
412
422
self .d ['cat_unordered' ] = Series (data ['I' ])
423
+ self .d ['numpy_bool_mixed' ] = Series (data ['J' ])
413
424
414
425
def test_basic (self ):
415
426
0 commit comments