我有两个 Dataframe ,df1和df2。
df1 = "R" : ["0.2","0.4","0.55"]
"Aa" : ["1","2","3']
"Ba" : ["5","6","6"]
df2 = "Rate" : ["0.2","0.55","0.2"]
"C" :["Aa","Aa","Ba"]
我希望代码查看C中的值,并返回与C列值完全匹配的df1列索引
预期产出:
C
Aa 1
Aa 1
Ba 2
我有两个 Dataframe ,df1和df2。
df1 = "R" : ["0.2","0.4","0.55"]
"Aa" : ["1","2","3']
"Ba" : ["5","6","6"]
df2 = "Rate" : ["0.2","0.55","0.2"]
"C" :["Aa","Aa","Ba"]
我希望代码查看C中的值,并返回与C列值完全匹配的df1列索引
预期产出:
C
Aa 1
Aa 1
Ba 2
1条答案
按热度按时间dfty9e191#
在列名及其位置之间应用Map: