From e133544a323930ba6bff887807afa3ded93145f9 Mon Sep 17 00:00:00 2001 From: Michael A Date: Mon, 9 Jan 2023 14:11:56 +0100 Subject: [PATCH 1/2] 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 98619bfaed2..0f2fc4b66de 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) From 665ab1d5b129c7de3f4b50e13b0d672d9192d0e6 Mon Sep 17 00:00:00 2001 From: Michael A Date: Mon, 9 Jan 2023 15:10:29 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a98864ddda1..7061ced7cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). this feature was anonymously sponsored: thank you to our sponsor! - Add `marker.cornerradius` attribute to `treemap` trace [[#6351](https://github.com/plotly/plotly.js/pull/6351)] ### Fixed - - Fixed the usage of sume deprecated NumPy types which were removed in NumPy 1.24 [[#3997](https://github.com/plotly/plotly.py/pull/3997)] + - Fixed the usage of some deprecated NumPy types which were removed in NumPy 1.24 [[#3997](https://github.com/plotly/plotly.py/pull/3997)] + - Fixed bug for trendlines with datetime axes [[#3683](https://github.com/plotly/plotly.py/issues/3683)] ## [5.11.0] - 2022-10-27