I have a table with a list of currencies as column in df1['Ccy]
Ccy
0 GBP
1 GBP
2 USD
3 EUR
4 GBP
5 USD
I have a second table that has values, df2:
Ccy FX Rate
0 USD 0.750244
1 JPY 0.007196
2 GBP 1.000000
3 EUR 0.893390
How can I create a mapping as a new column in df1 that has the FX Rate column values per respective currency, e.g:
Ccy FX Rate
0 GBP 1.000000
1 GBP 1.000000
2 USD 0.750244
3 EUR 0.893390
4 GBP 1.000000
5 USD 0.750244
I could do a mapping like the below but it replaces original currencies rather than creates a new column with the mapped numerical values: rename_dict = df2.set_index('Ccy').to_dict()['FX Rate'] df1 = df1.replace(rename_dict)
Want to simply add the mappings as a new column to the original df1.
Thanks!
You can merge two dataframes on "Ccy".
newdf = pd.merge(df1,df2,on="Ccy",how="left")
error: selenium.common.exceptions.TimeoutException: Message:
jetpack compose not responding to keyboard input on emulator
Hexagon Grid CSS - All hexagons change size when each of them is clicked
How to render HTML pages as PNG/JPEG images with URL array using Javascript only?
Get count of items that matches a condition from mongo db in node js
I am using socket-io for building a chat appAnd I have many custom events and for each event I want to pass different middleware function? In my case io
I've a running TYPO3 project on a Linux webserver and now I'm trying to get it working properly on a local Windows 10 machine with XAMPP for development purposes
I'm writing a program that renders mind mapsSo far, I've succeeded in drawing the root node and the first level of child nodes around it, in a circle