Back to Community
TypeError: Cannot compare tz-naive and tz-aware datetime-like objects.

Creating a Bayesian tear sheet but keep getting the error on the live_start date ```

pf.create_bayesian_tear_sheet(CR, live_start_date='2020-06-30')


TypeError Traceback (most recent call last)
in
----> 1 pf.create_bayesian_tear_sheet(CR, live_start_date=out_of_sample)

C:\Anaconda3\lib\site-packages\pyfolio\plotting.py in call_w_context(*args, **kwargs)
50 if set_context:
51 with plotting_context(), axes_style():
---> 52 return func(*args, **kwargs)
53 else:
54 return func(*args, **kwargs)

C:\Anaconda3\lib\site-packages\pyfolio\tears.py in create_bayesian_tear_sheet(returns, benchmark_rets, live_start_date, samples, return_fig, stoch_vol, progressbar)
1123
1124 live_start_date = ep.utils.get_utc_timestamp(live_start_date)
-> 1125 df_train = returns.loc[returns.index < live_start_date]
1126 df_test = returns.loc[returns.index >= live_start_date]
1127

C:\Anaconda3\lib\site-packages\pandas\core\indexes\datetimelike.py in wrapper(self, other)
130 other = other._values
131
--> 132 result = op(self._data, maybe_unwrap_index(other))
133 return result
134

C:\Anaconda3\lib\site-packages\pandas\core\arrays\datetimes.py in wrapper(self, other)
166 if isinstance(other, (datetime, np.datetime64)):
167 # GH#18435 strings get a pass from tzawareness compat
--> 168 self._assert_tzawareness_compat(other)
169
170 try:

C:\Anaconda3\lib\site-packages\pandas\core\arrays\datetimes.py in _assert_tzawareness_compat(self, other)
787 if other_tz is not None:
788 raise TypeError(
--> 789 "Cannot compare tz-naive and tz-aware " "datetime-like objects."
790 )
791 elif other_tz is None:

TypeError: Cannot compare tz-naive and tz-aware datetime-like objects.
```