Converting currency in pandas
I am trying to convert values with a different currency to the "USD" currency. I've tried packages easymoney
and CurrencyConvertor
, but they don't seem to work with python dataframe.
Seems to work if I do the conversion line by line with iloc
, but it takes a very long time.
from easymoney.money import EasyPeasy
ep = EasyPeasy()
ep.currency_converter(df_train['goal'], from_currency=df_train['currency'], to_currency="USD")
Error:
TypeError: Invalid type comparison
+3
source to share