Skip to content

Commit b507b2e

Browse files
committed
workaround for pandas issue pandas-dev/pandas#26258
1 parent d4703fd commit b507b2e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

timeboard/when.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def from_start_of_each(pi, normalize_by=None, **kwargs):
3737
start_times = pi.to_timestamp(how='start', freq='S')
3838
end_times = pi.to_timestamp(how='end', freq='S')
3939

40-
result = start_times + offset
40+
41+
# result = start_times + offset
42+
# The above raises VallueError in pandas > 0.22.
43+
# https://github.com/pandas-dev/pandas/issues/26258
44+
# Workaround:
45+
result = pd.DatetimeIndex([t + offset for t in start_times])
46+
4147
if normalize_by is not None:
4248
result = pd.PeriodIndex(result,
4349
freq=normalize_by).to_timestamp(how='start')

0 commit comments

Comments
 (0)