Converting time from Quandl to use with zipline

226 views
Skip to first unread message

Pumplerod

unread,
Nov 7, 2013, 3:11:06 PM11/7/13
to zip...@googlegroups.com
I am loading Quandl time series information into the data object and I run into trouble because it seems this time format is not what zipline is looking for.


Exception: Cannot compare tz-naive and tz-aware timestamps

Date
2000-01-01    2.0
2000-02-01    1.7
2000-03-01    1.7


can someone enlighten me as to how I can convert the incoming time series into what zipline is, in fact, looking for?

Eddie Hebert

unread,
Nov 7, 2013, 3:16:52 PM11/7/13
to Pumplerod, zip...@googlegroups.com
It looks like you need to get your DatetimeIndex into UTC.
One way to do so is to call the method `.tz_localize('UTC')` on your Series.

- Eddie
--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Pumplerod

unread,
Nov 7, 2013, 3:27:26 PM11/7/13
to zip...@googlegroups.com, Pumplerod
That seems to have done the trick.  Thank you so much.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.

tsando

unread,
Jul 23, 2016, 12:54:32 PM7/23/16
to Zipline Python Opensource Backtester, pump...@gmail.com
Thanks! That worked for me too :) Although I still get weird results when I plug in my returns... I'm working from a UK laptop so not sure if the time zone settings here are different to what pyfolio uses... 
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages