From 73cc580e0b784275febf6300e1d147cf02c2a8d7 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Wed, 26 Oct 2016 16:45:41 -0400 Subject: [PATCH] PERF: Remove attribute access in inner loop. --- zipline/data/data_portal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipline/data/data_portal.py b/zipline/data/data_portal.py index ad2a870d..8d111d37 100644 --- a/zipline/data/data_portal.py +++ b/zipline/data/data_portal.py @@ -19,6 +19,7 @@ from logbook import Logger import numpy as np from numpy import float64, int64 import pandas as pd +from pandas import isnull from pandas.tslib import normalize_date from six import iteritems from six.moves import reduce @@ -625,7 +626,7 @@ class DataPortal(object): if column == "last_traded": last_traded_dt = reader.get_last_traded_dt(asset, dt) - if pd.isnull(last_traded_dt): + if isnull(last_traded_dt): return pd.NaT else: return last_traded_dt