facs_data_analysis = utils.get_clean_factor_and_forward_returns(series_facs_datas,price)
代碼報錯:--------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-15-4645b0947281> in <module>
----> 1 facs_data_analysis = utils.get_clean_factor_and_forward_returns(series_facs_datas,price)
/usr/local/lib/python3.6/site-packages/alphalens/utils.py in get_clean_factor_and_forward_returns(factor, prices, groupby, binning_by_group, quantiles, bins, periods, filter_zscore, groupby_labels, max_loss, zero_aware, cumulative_returns)
837 quantiles=quantiles, bins=bins,
838 binning_by_group=binning_by_group,
--> 839 max_loss=max_loss, zero_aware=zero_aware)
840
841 return factor_data
/usr/local/lib/python3.6/site-packages/alphalens/utils.py in get_clean_factor(factor, forward_returns, groupby, binning_by_group, quantiles, bins, groupby_labels, max_loss, zero_aware)
593 factor_copy = factor.copy()
594 factor_copy.index = factor_copy.index.rename(['date', 'asset'])
--> 595 factor_copy = factor_copy[np.isfinite(factor_copy)]
596
597 merged_data = forward_returns.copy()
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
找不到原因啊;救救救 感謝
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/132262.html
