Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
phuvinhnguyen committed Dec 7, 2024
1 parent 1d64b1f commit 790f4a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autotrader/autoplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ def _merge_data(self, data: pd.DataFrame, name=None) -> pd.DataFrame:

# If self._data['date'] is timezone-aware (e.g., UTC), make data['date'] the same timezone-aware
if self._data['date'].dt.tz is not None:
data['date'] = data['date'].dt.tz_localize('UTC') # Adjust to match the timezone (UTC)
data['date'] = data.index.dt.tz_localize('UTC') # Adjust to match the timezone (UTC)
else:
data['date'] = data['date'].dt.tz_localize(None) # Make timezone-naive if self._data['date'] is naive
data['date'] = data.index.dt.tz_localize(None) # Make timezone-naive if self._data['date'] is naive

merged_data = pd.merge(
self._data, data, left_on="date", right_index=True
Expand Down

0 comments on commit 790f4a5

Please sign in to comment.