模拟交易时报错:ValueError: Bin edges must be unique: array

策略分享
标签: #<Tag:0x00007fb3e8b91ab0>

(BigQuant_9527) #1

之前在社区看到其他同学也出现这个问题,这个问题不是已经fix了吗?

[2019-02-28 17:58:11.881320] INFO: bigquant: instruments.v2 开始运行..
[2019-02-28 17:58:11.902683] INFO: bigquant: 命中缓存
[2019-02-28 17:58:11.904053] INFO: bigquant: instruments.v2 运行完成[0.02274s].
[2019-02-28 17:58:11.911173] INFO: bigquant: advanced_auto_labeler.v2 开始运行..
[2019-02-28 17:58:12.352055] INFO: 自动标注(股票): 加载历史数据: 3568 行
[2019-02-28 17:58:12.353717] INFO: 自动标注(股票): 开始标注 ..
[2019-02-28 17:58:12.471730] ERROR: bigquant: module name: advanced_auto_labeler, module version: v2, trackeback: Traceback (most recent call last):\nValueError: Bin edges must be unique: array([-inf,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,\n        nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  inf]).\nYou can drop duplicate edges by setting the 'duplicates' kwarg\n
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-9cf9ddf01d17> in <module>()
    113     benchmark='000300.SHA',
    114     drop_na_label=True,
--> 115     cast_label_int=True
    116 )
    117 

/var/app/enabled/biglearning/module2/common/modulemanagerv2.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.modulemanagerv2.BigQuantModuleVersion.__call__()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker.module_invoke()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._module_run()

/var/app/enabled/biglearning/module2/modules/advanced_auto_labeler/v2/__init__.py in run(self)
    123 
    124         for expr in self.__label_expr:
--> 125             df['label'] = bigexpr.evaluate(df, expr, self.__user_functions)
    126 
    127         if self.__drop_na_label:

/var/app/enabled/bigexpr/impl/expression.cpython-35m-x86_64-linux-gnu.so in bigexpr.impl.expression.evaluate()

/var/app/enabled/bigexpr/impl/expression.cpython-35m-x86_64-linux-gnu.so in bigexpr.impl.expression.__evaluate_ast()

/var/app/enabled/bigexpr/impl/functions.cpython-35m-x86_64-linux-gnu.so in bigexpr.impl.functions.UserFunctions.all_wbins()

/usr/local/python3/lib/python3.5/site-packages/pandas/core/reshape/tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest)
    134                               precision=precision,
    135                               include_lowest=include_lowest,
--> 136                               dtype=dtype)
    137 
    138     return _postprocess_for_cut(fac, bins, retbins, x_is_series,

/usr/local/python3/lib/python3.5/site-packages/pandas/core/reshape/tile.py in _bins_to_cuts(x, bins, right, labels, precision, include_lowest, dtype, duplicates)
    232             raise ValueError("Bin edges must be unique: {bins!r}.\nYou "
    233                              "can drop duplicate edges by setting "
--> 234                              "the 'duplicates' kwarg".format(bins=bins))
    235         else:
    236             bins = unique_bins

ValueError: Bin edges must be unique: array([-inf,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,
        nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  inf]).
You can drop duplicate edges by setting the 'duplicates' kwarg

(达达) #2

检查一下是不是训练集的证券代码列表的日期绑定实盘了