I have the following dataframe called df1.
Country ticker tickeralt finalticker
0 US AAPL AAPL.O
1 US BABA BABA.O
2 US AMD AMD.O
3 US MSFT MSFT.O
4 T 9984 9984.T
5 T 6752 6752.T
6 US EXC EXC.O
7 US PANW PANW.K
I want to do the following, if Country == 'US', then I want to set finalticker to whats in the ticker column for that row, and if its any other country but 'US', I want the finalticker for that row to be tickeralt, so it should look like this.
Country ticker tickeralt finalticker
0 US AAPL AAPL.O AAPL
1 US BABA BABA.O BABA
2 US AMD AMD.O AMD
3 US MSFT MSFT.O MSFT
4 T 9984 9984.T 9984.T
5 T 6752 6752.T 6752.T
6 US EXC EXC.O EXC
7 US PANW PANW.K PANW
How do I do this? I have no idea where to start.