@@ -2331,25 +2331,29 @@ def test_setitem_dtype_upcast(self):
2331
2331
assert_frame_equal (df ,expected )
2332
2332
2333
2333
# GH10280
2334
- df = DataFrame (np .arange (6 ).reshape (2 , 3 ), index = list ('ab' ),
2335
- columns = ['foo' , 'bar' , 'baz' ])
2334
+ df = DataFrame (np .arange (6 ,dtype = 'int64' ).reshape (2 , 3 ),
2335
+ index = list ('ab' ),
2336
+ columns = ['foo' , 'bar' , 'baz' ])
2336
2337
2337
2338
for val in [3.14 , 'wxyz' ]:
2338
2339
left = df .copy ()
2339
2340
left .loc ['a' , 'bar' ] = val
2340
- right = DataFrame ([[0 , val , 2 ], [3 , 4 , 5 ]], index = list ('ab' ),
2341
- columns = ['foo' , 'bar' , 'baz' ])
2341
+ right = DataFrame ([[0 , val , 2 ], [3 , 4 , 5 ]],
2342
+ index = list ('ab' ),
2343
+ columns = ['foo' , 'bar' , 'baz' ])
2342
2344
2343
2345
assert_frame_equal (left , right )
2344
2346
self .assertTrue (com .is_integer_dtype (left ['foo' ]))
2345
2347
self .assertTrue (com .is_integer_dtype (left ['baz' ]))
2346
2348
2347
- left = DataFrame (np .arange (6 ).reshape (2 , 3 ) / 10.0 , index = list ('ab' ),
2348
- columns = ['foo' , 'bar' , 'baz' ])
2349
+ left = DataFrame (np .arange (6 ,dtype = 'int64' ).reshape (2 , 3 ) / 10.0 ,
2350
+ index = list ('ab' ),
2351
+ columns = ['foo' , 'bar' , 'baz' ])
2349
2352
left .loc ['a' , 'bar' ] = 'wxyz'
2350
2353
2351
- right = DataFrame ([[0 , 'wxyz' , .2 ], [.3 , .4 , .5 ]], index = list ('ab' ),
2352
- columns = ['foo' , 'bar' , 'baz' ])
2354
+ right = DataFrame ([[0 , 'wxyz' , .2 ], [.3 , .4 , .5 ]],
2355
+ index = list ('ab' ),
2356
+ columns = ['foo' , 'bar' , 'baz' ])
2353
2357
2354
2358
assert_frame_equal (left , right )
2355
2359
self .assertTrue (com .is_float_dtype (left ['foo' ]))
0 commit comments