Skip to content

Commit b974465

Browse files
committed
force index to datetime
1 parent f37b86b commit b974465

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

vetiver/monitor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def compute_metrics(
4141
4242
"""
4343

44-
df = data[[truth, estimate, date_var]].set_index(date_var).sort_index()
44+
df = data[[truth, estimate, date_var]].copy()
45+
df[date_var] = pd.to_datetime(df[date_var])
46+
df = df.set_index(date_var).sort_index()
4547
lst = [_ for _ in _rolling_df(df=df, td=period)]
4648

4749
rows = []
@@ -169,7 +171,7 @@ def plot_metrics(
169171
color=metric,
170172
facet_row=metric,
171173
markers=dict(size=n),
172-
hover_data={"n": ':'},
174+
hover_data={"n": ":"},
173175
**kw,
174176
)
175177

0 commit comments

Comments
 (0)