url = (
    """http://ichart.finance.yahoo.com/table.csv?s=IBM&a=00&b=1&c=2011&d=11&e=31&f=2011&g=d&ignore=.csv"""
    )
reader = csv.reader(urllib.request.urlopen(url), delimiter=',')
cleaned = sorted([([r[0]] + map(float, r[1:])) for r in list(reader)[1:]])
Calculating difference between two rows in Python / Pandas