From 4c761c6708015d5371a47506e6051030b6ffa79c Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Thu, 21 Feb 2013 11:29:24 -0500 Subject: [PATCH] Prevents entire data panel being collapsed when a stock stops trading. The call to `Panel.dropna` after the fillna was deleting all values, if a stock stopped trading mid run and thus provided volume 0. i.e. if any sid had 0 non-null values the entire panel of frames would be truncated. It's possible to avoid the collapse via by adding the `how='all'` flag to `dropna`, however with the current tick based creation of the panel, the `dropna` with `how='all'` should be functionally equivalent to not dropping at all. The dropna has been dropped in favor of leaving the drop to algorithm code. --- zipline/transforms/utils.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zipline/transforms/utils.py b/zipline/transforms/utils.py index 9be939a6..72cc1f4c 100644 --- a/zipline/transforms/utils.py +++ b/zipline/transforms/utils.py @@ -493,10 +493,6 @@ class BatchTransform(EventWindow): # minute data because of illiquidity of one stock data = data.fillna(method='ffill') - # Drop any empty rows after the fill. - # This will drop a leading row of N/A - data = data.dropna(axis=1) - # Hold on to a reference to the data, # so that it's easier to find the current data when stepping # through with a debugger