I have a pandas dataframe like the following:
A B
US,65,AMAZON 2016
US,65,EBAY 2016
My goal is to get to look like this:
A B country code com
US.65.AMAZON 2016 US 65 AMAZON
US.65.AMAZON 2016 US 65 EBAY
I know this question has been asked before here and here but none of them works for me. I have tried:
df['country','code','com'] = df.Field.str.split('.')
and
df2 = pd.DataFrame(df.Field.str.split('.').tolist(),columns = ['country','code','com','A','B'])
Am I missing something? Any help is much appreciated.