Skip to content

Commit 20b9215

Browse files
committed
No need to use pd.api.types.is_string_dtype anymore
1 parent 3661e54 commit 20b9215

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pygmt/clib/conversion.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ def vectors_to_arrays(vectors: Sequence[Any]) -> list[np.ndarray]:
228228
# If fails, then the array can't be recognized.
229229
if array.dtype.type == np.object_:
230230
try:
231-
array = np.asarray(array, dtype=np.datetime64)
231+
array = np.ascontiguousarray(array, dtype=np.datetime64)
232232
except ValueError:
233-
array = np.asarray(array, dtype=np.str_)
233+
array = np.ascontiguousarray(array, dtype=np.str_)
234234
arrays.append(array)
235235
return arrays
236236

pygmt/clib/session.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ def virtualfile_from_vectors(self, *vectors):
13781378
# Assumes that first 2 columns contains coordinates like longitude
13791379
# latitude, or datetime string types.
13801380
for col, array in enumerate(arrays[2:]):
1381-
if pd.api.types.is_string_dtype(array.dtype):
1381+
if array.dtype.type == np.str_:
13821382
columns = col + 2
13831383
break
13841384

0 commit comments

Comments
 (0)