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 77a2d59 commit 8b9ec5aCopy full SHA for 8b9ec5a
pygmt/clib/conversion.py
@@ -205,6 +205,11 @@ def _to_numpy(data: Any) -> np.ndarray:
205
206
array = np.ascontiguousarray(data, dtype=numpy_dtype)
207
208
+ # Check if a np.object_ or np.str_ array can be converted to np.datetime64.
209
+ if array.dtype.type in {np.object_, np.str_}:
210
+ with contextlib.suppress(TypeError, ValueError):
211
+ return np.ascontiguousarray(array, dtype=np.datetime64)
212
+
213
# Check if a np.object_ array can be converted to np.str_.
214
if array.dtype == np.object_:
215
with contextlib.suppress(TypeError, ValueError):
0 commit comments