@@ -964,8 +964,8 @@ def test_concat_dict(self):
964
964
tm .assert_frame_equal (result , expected )
965
965
966
966
def test_concat_ignore_index (self ):
967
- frame1 = DataFrame ({"test1" : ["a" , "b" , "c" ],
968
- "test2" : [1 ,2 ,3 ],
967
+ frame1 = DataFrame ({"test1" : ["a" , "b" , "c" ],
968
+ "test2" : [1 ,2 ,3 ],
969
969
"test3" : [4.5 , 3.2 , 1.2 ]})
970
970
frame2 = DataFrame ({"test3" : [5.2 , 2.2 , 4.3 ]})
971
971
frame1 .index = Index (["x" , "y" , "z" ])
@@ -974,12 +974,12 @@ def test_concat_ignore_index(self):
974
974
v1 = concat ([frame1 , frame2 ], axis = 1 , ignore_index = True )
975
975
976
976
nan = np .nan
977
- expected = DataFrame ([[nan ,nan ,nan , 4.3 ],
977
+ expected = DataFrame ([[nan ,nan ,nan , 4.3 ],
978
978
['a' , 1 , 4.5 , 5.2 ],
979
979
['b' , 2 , 3.2 , 2.2 ],
980
- ['c' , 3 , 1.2 , nan ]],
980
+ ['c' , 3 , 1.2 , nan ]],
981
981
index = Index (["q" , "x" , "y" , "z" ]))
982
-
982
+
983
983
tm .assert_frame_equal (v1 , expected )
984
984
985
985
def test_concat_multiindex_with_keys (self ):
@@ -1221,6 +1221,20 @@ def test_concat_exclude_none(self):
1221
1221
tm .assert_frame_equal (result , df )
1222
1222
self .assertRaises (Exception , concat , [None , None ])
1223
1223
1224
+ def test_mixed_type_join_with_suffix (self ):
1225
+ # GH #916
1226
+ df = DataFrame (np .random .randn (20 , 6 ),
1227
+ columns = ['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
1228
+ df .insert (0 , 'id' , 0 )
1229
+ df .insert (5 , 'dt' , 'foo' )
1230
+
1231
+ grouped = df .groupby ('id' )
1232
+ mn = grouped .mean ()
1233
+ cn = grouped .count ()
1234
+
1235
+ # it works!
1236
+ mn .join (cn , rsuffix = '_right' )
1237
+
1224
1238
if __name__ == '__main__' :
1225
1239
import nose
1226
1240
nose .runmodule (argv = [__file__ ,'-vvs' ,'-x' ,'--pdb' , '--pdb-failure' ],
0 commit comments