From e133544a323930ba6bff887807afa3ded93145f9 Mon Sep 17 00:00:00 2001 From: Michael A Date: Mon, 9 Jan 2023 14:11:56 +0100 Subject: [PATCH] Fix trendlines for datetimes (#3683) --- packages/python/plotly/plotly/express/_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index 98619bfaed..0f2fc4b66d 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -328,7 +328,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref): x = sorted_trace_data[args["x"]].values if x.dtype.type == np.datetime64: - x = x.astype(int) / 10**9 # convert to unix epoch seconds + x = x.astype(np.int64) / 10**9 # convert to unix epoch seconds elif x.dtype.type == np.object_: try: x = x.astype(np.float64)