I have a dataframe called staticData which looks like this:
narrow_sector broad_sector country exchange \
unique_id
BBG.MTAA.STM.S Semiconductors Technology CH MTAA
BBG.MTAA.CNHI.S Machinery-Diversified Industrial GB MTAA
BBG.MTAA.FCA.S Auto Manufacturers Consumer Cyclical GB MTAA
BBG.MTAA.A2A.S Electric Utilities IT MTAA
BBG.MTAA.ACE.S Electric Utilities IT MTAA
I am trying to iterate through the dataframe row by row picking out two bits of information the index (unique_id) and the exchange. I am having a problem iterating on the index. Please see my code:
for i, row in staticData.iterrows():
unique_id = staticData.ix[i]
exchange = row['exchange']
I have tried unique_id = row['unique_id']
, but can't get it to work...
I am trying to return say for row1
unique_id = BBG.MTAA.STM.S
exchange = MTAA