File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1712,6 +1712,19 @@ def test_append_records(self):
1712
1712
expected = DataFrame (np .concatenate ((arr1 , arr2 )))
1713
1713
assert_frame_equal (result , expected )
1714
1714
1715
+ def test_append_different_columns (self ):
1716
+ df = DataFrame ({'bools' : np .random .randn (10 ) > 0 ,
1717
+ 'ints' : np .random .randint (0 , 10 , 10 ),
1718
+ 'floats' : np .random .randn (10 ),
1719
+ 'strings' : ['foo' , 'bar' ] * 5 })
1720
+
1721
+ a = df [:5 ].ix [:, ['bools' , 'ints' , 'floats' ]]
1722
+ b = df [5 :].ix [:, ['strings' , 'ints' , 'floats' ]]
1723
+
1724
+ appended = a .append (b )
1725
+ self .assert_ (isnull (appended ['strings' ][:5 ]).all ())
1726
+ self .assert_ (isnull (appended ['bools' ][5 :]).all ())
1727
+
1715
1728
def test_asfreq (self ):
1716
1729
offset_monthly = self .tsframe .asfreq (datetools .bmonthEnd )
1717
1730
rule_monthly = self .tsframe .asfreq ('EOM' )
You can’t perform that action at this time.
0 commit comments