Skip to content

Commit

Permalink
Fix trendlines for datetimes (plotly#3683)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ad authored Jan 9, 2023
1 parent a8a0c9b commit e133544
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/python/plotly/plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e133544

Please sign in to comment.