MAINT: Change shape of supplemental data to match batch data.

Expect the same shape of data for the supplemental data, to make
working and preparing with the supplemental data consistent with
what is passed to the algorithm.
This commit is contained in:
Eddie Hebert
2013-09-16 11:51:22 -04:00
parent 7b8769b3e7
commit ddb541b9b3
+7 -7
View File
@@ -285,19 +285,19 @@ class BatchTransform(object):
if self.supplemental_data:
for item in data.items:
# axes[1] (minor axis) will be a date stamp
if item not in self.supplemental_data.major_axis:
if item not in self.supplemental_data.items:
continue
for dt in data.axes[1]:
for dt in data.major_axis:
try:
supplemental_for_date = self.supplemental_data[dt]
supplemental_for_dt = self.supplemental_data.ix[
item, dt, :]
except KeyError:
# Only filling in data available in supplemental data.
supplemental_for_date = None
supplemental_for_dt = None
if supplemental_for_date is not None:
if supplemental_for_dt is not None:
data[item].ix[dt] = \
supplemental_for_date.ix[item].combine_first(
supplemental_for_dt.combine_first(
data[item].ix[dt])
if self.clean_nans: