From 028ba719a28dffb4b14575cd0f35fab94faeedc2 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Thu, 2 Oct 2014 18:09:51 -0400 Subject: [PATCH] BUG: Fix numpy dtype casting bug that only manifests in pandas 0.14.0. --- zipline/history/history_container.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zipline/history/history_container.py b/zipline/history/history_container.py index 4eb6b7ee..d49d4dd1 100644 --- a/zipline/history/history_container.py +++ b/zipline/history/history_container.py @@ -551,14 +551,15 @@ def fast_build_history_output(buffer_frame, last_period, algo_dt): def fast_append_date_to_index(index, timestamp): """ - Append a timestamp to a DatetimeIndex. DatetimeIndex.append throws an - error on pandas 0.12.0 + Append a timestamp to a DatetimeIndex. DatetimeIndex.append does not + appear to work. """ return pd.DatetimeIndex( np.hstack( [ index.values, - [timestamp], + [timestamp.asm8], ] - ) + ), + tz='UTC', )