title: Python timedelta driving me crazy
body: <p>I have this dataset:</p>
  <pre><code>        date    event                                 ticker initialprice finalprice
  0   2010-11-18  MELA Mela Sciences FDA Panel            MEL     0.0 0.0
  1   2010-12-07  OREX Orexigen Therapeutics Inc PDUFA    OREX    0.0 0.0
  2   2010-12-07  SLXP SALIX PHARMACEUTICALS LTD PDUFA    SLXP    0.0 0.0
  3   2010-12-09  HGSI HUMAN GENOME SCIENCES INC PDUFA    HGSI    0.0 0.0
  4   2010-12-16  AZN Astrazeneca PDUFA   AZN 0.0 0.0
  </code></pre>
  <p>and I would like to retrieve for each row the stock price for that exact date and for one week before that date, i wrote this code but breaks when i use timedelta:</p>
  <pre><code>import datetime
  from datetime import timedelta
  for index, row in fda.iterrows():
    try:
      ticker=row['ticker']
      print(ticker)
      end_date0=row['date'].strftime('%Y-%m-%d')
      end_date1= row['date'] + timedelta(days=1)
      print(end_date1)
      end_date1=end_date1.strftime('%Y-%m-%d')
      start_date0=row['date'] - timedelta(days=7)
      start_date1= row['date'] - timedelta(days=6)
      start_date0=start_date0.strftime('%Y-%m-%d')
      start_date1=start_date1.strftime('%Y-%m-%d')
      yahoo_financials = YahooFinancials(ticker)
      data = yahoo_financials.get_historical_price_data(start_date=end_date0, 
                                                    end_date=end_date1, 
                                                    time_interval='daily')
      aapl_df = pd.DataFrame(data[ticker]['prices'])
      price=float(aapl_df.iloc[0,4])
      print(end_date0,end_date1,price)
      row['finalprice']=float(price)
      data = yahoo_financials.get_historical_price_data(start_date=start_date0, 
                                                    end_date=start_date1, 
                                                    time_interval='daily')
      aapl_df = pd.DataFrame(data[ticker]['prices'])
      price=float(aapl_df.iloc[0,4])
      print(start_date0,start_date1,price)
      row['initialprice']=float(price)
    except:
      pass
  </code></pre>