From 76c32f2940b09319a4545bb1b276371922fbd2c1 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Sat, 18 Oct 2014 16:49:27 -0400 Subject: [PATCH] PERF: Use np.empty instead of np.ones. No reason to use ones when we multiply everything by NaN immediately. --- zipline/history/history_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/history/history_container.py b/zipline/history/history_container.py index 5c106ad0..8793cec2 100644 --- a/zipline/history/history_container.py +++ b/zipline/history/history_container.py @@ -366,7 +366,7 @@ class HistoryContainer(object): Create a DataFrame from the given BarData and algo dt. """ data = data._data - frame_data = np.ones((len(self.fields), len(self.sids))) * np.nan + frame_data = np.empty((len(self.fields), len(self.sids))) * np.nan for j, sid in enumerate(self.sids): sid_data = data.get(sid)