BUG: Fix missing values from supplemental data in batch transform.

Adapt the supplemental data fill so that it works with the new
shape of the batch transform that was switched to with the rolling
panel optimizations.
This commit is contained in:
Eddie Hebert
2013-05-07 18:17:08 -04:00
parent d3ade5050c
commit 5c883659b5
+12 -7
View File
@@ -501,14 +501,19 @@ class BatchTransform(object):
data = self.rolling_panel.get_current()
if self.supplemental_data:
# item will be a date stamp
for item in data.items:
try:
data[item] = self.supplemental_data[item].combine_first(
data[item])
except KeyError:
# Only filling in data available in supplemental data.
pass
# axes[1] (minor axis) will be a date stamp
for dt in data.axes[1]:
try:
supplemental_for_date = self.supplemental_data[dt]
except KeyError:
# Only filling in data available in supplemental data.
supplemental_for_date = None
if supplemental_for_date is not None:
data[item].ix[dt] = \
supplemental_for_date.ix[item].combine_first(
data[item].ix[dt])
if self.clean_nans:
# Fills in gaps of missing data during transform