Closed PeterSikuda closed 5 years ago
If you could upgrade Alphalens to version 0.3.6 that should fix the issue.
Just to give more background information: we improved Alphalens compatibility with recent pandas versions (tested up to pandas 0.23.4) in one of the latest Alphalens releases. So it should worth upgrading Alphalens and see how it works.
thanks. upgrading to version 0.3.6 fixed the issue.
Problem Description
I am trying to process factor, pricing data for alphalens analysis, but got this error.
TypeError: Iterator operand 0 dtype could not be cast from dtype('<M8[us]') to dtype('<M8[D]') according to the rule 'safe'
DatetimeIndex(['2018-05-31', '2018-06-01', '2018-06-02', '2018-06-03', '2018-06-04', '2018-06-05', '2018-06-06', '2018-06-07', '2018-06-08', '2018-06-09', ... '2019-03-22', '2019-03-23', '2019-03-24', '2019-03-25', '2019-03-26', '2019-03-27', '2019-03-28', '2019-03-29', '2019-03-30', '2019-03-31'], dtype='datetime64[ns]', length=305, freq=None)
DatetimeIndex(['2018-05-31', '2018-06-01', '2018-06-02', '2018-06-03', '2018-06-04', '2018-06-05', '2018-06-06', '2018-06-07', '2018-06-08', '2018-06-09', ... '2019-03-22', '2019-03-23', '2019-03-24', '2019-03-25', '2019-03-26', '2019-03-27', '2019-03-28', '2019-03-29', '2019-03-30', '2019-03-31'], dtype='datetime64[ns]', name='datetime', length=305, freq=None)
Also tried:
but didn't help.
Versions