1
我有一个DF执行算术对字典
product currency price
a USD 2
b AUD 3
c GBP 9
....
被引用,我有一个字典:
cc={"USD": 1, "AUD":.75, "GBP: 1.13}
我想改价乘以价格乘以CC字典中对应货币的价值,所以我尝试过:
df.price.apply(lambda x: x*cc[df['currency']])
其中给出错误
TypeError: 'Series' objects are mutable, thus they cannot be hashed
谢谢!