Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
fetch_csv not pulling integers

Hi I'm trying to pull a csv of daily commodity prices and calculate trailing averages etc. Just to illustrate the error, it appears the values are coming in as str instead of integers. what am I missing here? Thanks!

import datetime
import numpy as np
import pandas as pd

def initialize(context):
## schedule_function(record_vars,
## date_rules.every_day(),
## time_rules.market_open())
schedule_function(populate,
date_rules.every_day(),
time_rules.market_open())
fetch_csv('https://dl.dropboxusercontent.com/s/ao7lm4dko14t5y1/report%20%288%29.csv?dl=0',
date_column = 'Date',
symbol = 'Prices',
date_format = '%-m/%d/%Y'
)
context.prices = []

def populate(context, data):
current_price = data.current('Prices','Volume')
context.prices.append(current_price)
aggregate = 0
for i in context.prices:
aggregate = aggregate + context.prices[i]