File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -718,11 +718,11 @@ def test_index_type_coercion(self):
718
718
assert s2 .index .is_object ()
719
719
720
720
def test_empty_index_for_empty_dataframe (self ):
721
- index = pd .Index ([], name = 'idx' )
722
- df = pd .DataFrame (columns = ['A' ], index = index )
723
- df2 = df . copy ()
724
- df ['A' ] = []
725
- tm .assert_index_equal (df .index , df2 .index )
721
+ index = pd .Index ([], name = 'idx' )
722
+ result = pd .DataFrame (columns = ['A' ], index = index )
723
+ result [ 'A' ] = []
724
+ expected = pd . DataFrame ( columns = ['A' ], index = index )
725
+ tm .assert_index_equal (result .index , expected .index )
726
726
727
727
728
728
class TestMisc (Base ):
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ def test_partial_set_empty_frame(self):
451
451
# these work as they don't really change
452
452
# anything but the index
453
453
# GH5632
454
- expected = DataFrame (columns = ['foo' ], index = Index ([]))
454
+ expected = DataFrame (columns = ['foo' ], index = Index ([], dtype = 'int64' ))
455
455
456
456
def f ():
457
457
df = DataFrame ()
You can’t perform that action at this time.
0 commit comments