Skip to content

Commit

Permalink
Relaxing pandas requirements to version 1.0.5 (#800)
Browse files Browse the repository at this point in the history
* Fixes for pandas 1.0.5

* Requirements pandas>=1.0.5
  • Loading branch information
adelnick committed Feb 16, 2022
1 parent 00cd099 commit cd361e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion darts/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def from_dataframe(
time_index = df.index

if not time_index.name:
time_index.name = DIMS[0]
time_index.name = time_col if time_col else DIMS[0]

xa = xr.DataArray(
series_df.values[:, :, np.newaxis],
Expand Down Expand Up @@ -1796,6 +1796,8 @@ def shift(self, n: int) -> "TimeSeries":
new_time_index = self._time_index + n * self.freq
else:
new_time_index = self._time_index.map(lambda ts: ts + n * self.freq)
if new_time_index.freq is None:
new_time_index.freq = self.freq
new_xa = self._xa.assign_coords({self._xa.dims[0]: new_time_index})
return self.__class__(new_xa)

Expand Down
2 changes: 1 addition & 1 deletion requirements/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lightgbm>=2.2.3
matplotlib>=3.3.0
nfoursid>=1.0.0
numpy>=1.19.0
pandas>=1.1.0
pandas>=1.0.5
requests>=2.22.0
scikit-learn>=1.0.1
scipy>=1.3.2
Expand Down

0 comments on commit cd361e3

Please sign in to comment.