我有一个类似下面命名为df的数据帧
Name | property | location | messsage |
---|---|---|---|
John | house | london | recently bought |
Adam | company | newyork | old one |
另一个类似下面命名为df1的数据帧
S.No. | APIname | Up_ApiName |
---|---|---|
1 | rice | rice_c |
2 | Name | Name_new |
3 | property | Asset |
4 | location | Site |
5 | message | comment |
我希望只更新df中的列名,这些列应该与df1 APIname中的列匹配,然后它必须使用up_ApiName中的值进行更新
因此,新数据如下所示
Name_new | Asset | Site | comment |
---|---|---|---|
John | house | london | recently bought |
Adam | company | newyork | old one |