We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a13e4f commit 4d4fa4fCopy full SHA for 4d4fa4f
tests/test_optional/test_graph_objs/test_numpy.py
@@ -0,0 +1,16 @@
1
+from datetime import datetime
2
+
3
+import numpy as np
4
5
+import plotly.graph_objs as go
6
7
8
+def test_np_ns_datetime():
9
+ x = [np.datetime64("2025-09-26").astype("datetime64[ns]")]
10
+ y = [1.23]
11
+ scatter = go.Scatter(x=x, y=y, mode="markers")
12
13
+ # x value should be converted to native datetime
14
+ assert isinstance(scatter.x[0], datetime)
15
+ # x value should match original numpy value at microsecond precision
16
+ assert x[0].astype("datetime64[us]").item() == scatter.x[0]
0 commit comments