Skip to content

Commit 01ba317

Browse files
committed
Mapping 'string' to np.str_ explicitly
1 parent d3f1611 commit 01ba317

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pygmt/clib/conversion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def _to_numpy(data: Any) -> np.ndarray:
158158
"""
159159
# Mapping of unsupported dtypes to the expected NumPy dtype.
160160
dtypes: dict[str, type] = {
161+
# For pandas string dtype, "string[python]", "string[pyarrow]" and
162+
# "string[pyarrow_numpy]".
163+
"string": np.str_,
161164
"date32[day][pyarrow]": np.datetime64,
162165
"date64[ms][pyarrow]": np.datetime64,
163166
}

0 commit comments

Comments
 (0)