In pandas I have created a dataframe from importing from CSV.
data = pd.read_csv('pathToCSV', index_col=[0],usecols=[0,2,3],names=['Date','High','Low'])
Output looks like this-
2009.09.18 112 111
2009.09.19 114 222
Now what if I want to calculate an average of the two columns, row by row, and then add the value as a new column? What I did was
average = (data[1]+data[2])/2
Then
data.join(average)
But I get an error! I am doing this correct?