mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-06 05:14:38 +08:00
BUG: Use a "real" index in NoOpFFCEngine.
This makes us return an empty DataFrame in data.factors instead of barfing.
This commit is contained in:
@@ -27,6 +27,7 @@ from numpy import (
|
||||
)
|
||||
from pandas import (
|
||||
DataFrame,
|
||||
date_range,
|
||||
MultiIndex,
|
||||
)
|
||||
|
||||
@@ -149,7 +150,12 @@ class NoOpFFCEngine(FFCEngine):
|
||||
"""
|
||||
|
||||
def factor_matrix(self, terms, start, end):
|
||||
return DataFrame(index=[], columns=sorted(terms.keys()))
|
||||
return DataFrame(
|
||||
index=MultiIndex.from_product(
|
||||
[date_range(start=start, end=end, freq='D'), ()],
|
||||
),
|
||||
columns=sorted(terms.keys())
|
||||
)
|
||||
|
||||
|
||||
class SimpleFFCEngine(object):
|
||||
|
||||
Reference in New Issue
Block a user