如果两个数据帧中的数据相同,则映射列名称

时间:2016-04-20 00:12:31

标签: pandas dataframe names

我有两个pandas数据帧

df1 = A B C.       1 2 3       2 3 4       3 4 5

df2 = X Y Z.       1 2 3       2 3 4       3 4 5 我需要根据数据进行映射如果数据相同则映射列名enter code here 输出= col1 col2           一个X.           B Y.           C Z

1 个答案:

答案 0 :(得分:1)

我找不到任何内置函数来支持它,因此只需遍历所有列:

override func viewDidLoad() {
    super.viewDidLoad()
    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(testNot), name: "testNotification", object: nil)
    updateView()
}
相关问题