Skip to content

Commit 4364e0d

Browse files
committed
Remove the workaround in PR #684
1 parent dac7e8e commit 4364e0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ def virtualfile_from_vectors(
14751475
# 2 columns contains coordinates like longitude, latitude, or datetime string
14761476
# types.
14771477
for col, array in enumerate(arrays[2:]):
1478-
if pd.api.types.is_string_dtype(array.dtype):
1478+
if np.issubdtype(array.dtype, np.str_):
14791479
columns = col + 2
14801480
break
14811481

@@ -1506,9 +1506,9 @@ def virtualfile_from_vectors(
15061506
strings = string_arrays[0]
15071507
elif len(string_arrays) > 1:
15081508
strings = np.array(
1509-
[" ".join(vals) for vals in zip(*string_arrays, strict=True)]
1509+
[" ".join(vals) for vals in zip(*string_arrays, strict=True)],
1510+
dtype=np.str_,
15101511
)
1511-
strings = np.asanyarray(a=strings, dtype=np.str_)
15121512
self.put_strings(
15131513
dataset, family="GMT_IS_VECTOR|GMT_IS_DUPLICATE", strings=strings
15141514
)

0 commit comments

Comments
 (0)