2
我想在多个列上执行熊猫合并,其中一列是索引列。熊猫 - 如何在多个列上进行合并,包括索引
下面是示例dataframes:
df1 = pd.DataFrame(np.random.rand(4,4), columns=list('ABCD'))
df2 = pd.DataFrame(np.random.rand(4,4), columns=list('EFGH'), index= [5,2,4,1])
df1['E'] = ['hello','hello','hello','world']
df2['E'] = ['world','world','hello','hello']
我想执行所述索引和塔E的内合并,使得它会返回仅一排:(指数,E)=(1,'你好“)。