Back to Community
Problem with backtest: Cannot compare tz-naive and tz-aware timestamps

Did someone confront with the problem like this below, I have change the timestamp format, but it is still not work.

import datetime
import pytz
dt=pd.to_datetime('2019-06-05').tz_localize('UTC')
rtn.index = rtn.index.normalize()
if rtn.index.tzinfo is None:
rtn.index = rtn.tz_localize('UTC')

pf.create_returns_tear_sheet(rtn['strategy'],live_start_date=dt,benchmark_rets=rtn['rtn_M'])