【发布时间】:2013-11-19 14:01:51
【问题描述】:
我正在阅读的代码使用@batch_transform。 @ 符号有什么作用?是 ipython 特有的吗?
from zipline.transforms import batch_transform
from scipy import stats
@batch_transform
def regression_transform(data):
pep_price = data.price['PEP']
ko_price = data.price['KO']
slope, intercept, _, _, _ = stats.linregress(pep_price, ko_price)
return intercept, slope
【问题讨论】:
标签: python python-2.7 ipython ipython-notebook zipline