Here is an example of my data,
match_type search campaign group
phrase physicians Branded System phrase
phrase locations Branded System phrase
exact find Non-Branded Brand exact
I am using csv.reader to read in a csv I have.
with open("pos_input.csv") as csvfile:
inputcsv = csv.reader(csvfile, delimiter=',')
for row in inputcsv:
match = row[1:2]
search = row[2:3]
campaign = row[3:4]
ad = row[4:]
I am then assigning each column in the csv to an object. For example the first column holds values about each row. So,
print(campaign)
would result in
['Campaign']
['Branded System']
['Branded System']
['Non-Branded Brand']
campaign being the column header and then each string after represents a row input.
My question is, how do I access just 'Non-Branded Brand'. I have tried this,
campaign[3]
but results in an error,
IndexError: list index out of range
Do I need to do some converting here?