Avoid pandas Timedelta(days=1) deprecation warning
pd.Timedelta(days=1) triggers a DeprecationWarning about NumPy's "generic" timedelta unit in this pandas version; pd.Timedelta(1, unit="D") is equivalent and warning-free.
This commit is contained in:
@@ -90,7 +90,7 @@ fig = make_subplots(
|
||||
for i, day in enumerate(dates, start=1):
|
||||
day_df = glucose[glucose["date"] == day]
|
||||
day_start = pd.Timestamp(day)
|
||||
day_end = day_start + pd.Timedelta(days=1)
|
||||
day_end = day_start + pd.Timedelta(1, unit="D")
|
||||
|
||||
fig.add_hrect(
|
||||
y0=TARGET_LOW, y1=TARGET_HIGH, fillcolor=colors["band"], line_width=0, layer="below", row=i, col=1
|
||||
|
||||
Reference in New Issue
Block a user