score:0

Without giving it too much thought:

if df1.shape[0] > df2.shape[0]:
    new_rows = df1.shape[0] - df2.shape[0]
    df3 = pd.DataFrame(np.zeros((new_rows, df2.shape[1])))
    df2 = df2.append(df3)
    new_df = pd.concat((df1, df2), axis=1)
#Alternative elif goes here doing the converse.

score:1

I think you need a join and fillna

print(df2.join(df1).fillna(''))

10.17  6.58  5.23  10.74 5.71  5.41
 9.99  5.75  5.13  11.44  6.1  5.87
11.21  6.35  5.72                  
10.30  5.86  5.12  

Related Query

More Query from same tag