@@ -337,23 +337,24 @@ def test_concat_sparse_dense(self, fill_value):
337337 exp = pd .concat ([self .dense3 , self .dense1 ], axis = 1 )
338338 # See GH18914 and #18686 for why this should be
339339 # A DataFrame
340- assert isinstance (res , pd .DataFrame )
340+ assert type (res ) is pd .DataFrame
341341 # See GH16874
342- assert res .isnull ()
343- assert res [res .columns [0 ]]
344- assert res .iloc [0 ,0 ]
342+ assert not res .isnull ().empty
343+ assert not res [res .columns [0 ]].empty
344+ assert res .iloc [0 ,0 ] == self .dense3 .iloc [0 ,0 ]
345+
345346 for column in self .dense3 .columns :
346347 tm .assert_series_equal (res [column ], exp [column ])
347348
348349 tm .assert_frame_equal (res , exp )
349350
350351 res = pd .concat ([sparse , self .dense3 ], axis = 1 )
351352 exp = pd .concat ([self .dense1 , self .dense3 ], axis = 1 )
352- assert isinstance (res , pd .DataFrame )
353+ assert type (res ) is pd .DataFrame
353354 # See GH16874
354- assert res .isnull ()
355- assert res [res .columns [0 ]]
356- assert res .iloc [0 ,0 ]
355+ assert not res .isnull (). empty
356+ assert not res [res .columns [0 ]]. empty
357+ assert res .iloc [0 ,0 ] == sparse . iloc [ 0 , 0 ]
357358 for column in self .dense3 .columns :
358359 tm .assert_series_equal (res [column ], exp [column ])
359360 tm .assert_frame_equal (res , exp )
0 commit comments