Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
gj Sentiment Analysis code error

Can any one tell me why the following code did not work? I got error at fetch_csv line of code. thanks.

def preview(df):
log.info(df.head())
return df

def initialize(context):
"""
Called once at the start of the algorithm.
"""
# Rebalance every day, 1 hour after market open.
schedule_function(my_rebalance, date_rules.every_day(), time_rules.market_open(hours=1))

# Record tracking variables at the end of each day.  
schedule_function(my_record_vars, date_rules.every_day(), time_rules.market_close())  

# Create our dynamic stock selector.  
attach_pipeline(make_pipeline(), 'my_pipeline')  

context.investment_size = (context.portfolio.cash / 10.0)  

context.stop_loss_pct = 0.995  
set_symbol_lookup_date('2012-10-01')  

fetch_csv('http://sentdex.com/api/finance/sentiment-signals/sample/', pre_func = preview )