Home > other >  Quantitative trading alphalens utils to quote
Quantitative trading alphalens utils to quote

Time:09-26

Facs_data_analysis=utils. Get_clean_factor_and_forward_returns (series_facs_datas, price)

Error code: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
TypeError Traceback (the most recent call last)
& lt; Ipython - input - 15-4645 b0947281 & gt; In & lt; module>
- & gt; 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. The copy ()
594 factor_copy. Index=factor_copy. Index. Rename ([' date ', 'asset'])
--> 595 factor_copy=factor_copy [np isfinite (factor_copy)]
596
597 merged_data=https://bbs.csdn.net/topics/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'


Can't find the reason; Thank you help save
  • Related