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 923ae8e commit 6083058Copy full SHA for 6083058
pygmt/clib/conversion.py
@@ -188,7 +188,7 @@ def _to_numpy(data: Any) -> np.ndarray:
188
# Integer dtypes with missing values are cast to NumPy float dtypes and NaN
189
# is used as missing value indicator.
190
dtype = np.float64 if data.dtype.kind in "iu" else data.dtype.numpy_dtype
191
- data = data.to_numpy(dtype=dtype, na_value=np.nan)
+ data = data.to_numpy(na_value=np.nan).astype(dtype=dtype)
192
193
vec_dtype = str(getattr(data, "dtype", ""))
194
array = np.ascontiguousarray(data, dtype=dtypes.get(vec_dtype))
0 commit comments