this is my dataframe:
df = pd.DataFrame({'symbol': ['msft', 'amd', 'bac', 'citi'], 'close': [100, 30, 70, 80]})
I want to add another column called sector
that checks the values of symbol
and add the values that I want (tech
for amd
and msft
for example).
My desired outcome looks like this:
symbol close sector
0 msft 100 tech
1 amd 30 tech
2 bac 70 bank
3 citi 80 bank