Averaging a list of tuples from CSV file
<p>For a personal project, I have a fairly large .CSV file of Apple's past stock data. I already have a function using the csv module to read this data and print out the date and the month's closing price:</p>

<p>Here's an example of the format of the tuple:</p>

<pre><code>('2012-03-24' , '122.10')
</code></pre>

<p>What I am now looking to average the data for each month and regenerate the list of tuples.</p>

<p>Does anyone have any suggestions? I'm a beginning Python student.</p>

<pre><code>def get_list_data(file_obj, column_number):    
    with open("table.csv", "r") as f:
        reader = csv.reader(f, delimiter=',')
        for row in reader:
            data = row[0] , row[column_number]  #Data and column data
            list_of_tuples = tuple(data)
            print(list_of_tuples)

    return list_of_tuples

def average_data(list_of_tuples):  #This is where I am stuck
</code></pre>
