Skip to content

Commit bf8c9a5

Browse files
committed
Simplify
1 parent 7ae437f commit bf8c9a5

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pygmt/clib/conversion.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,11 @@ def _to_ndarray(array: Any) -> np.ndarray:
181181
"Float64": np.float64,
182182
}
183183
)
184+
if hasattr(array, "isna") and array.isna().any():
185+
array = array.astype(np.float64)
184186

185-
if (
186-
hasattr(array, "isna")
187-
and array.isna().any()
188-
and Version(pd.__version__) < Version("2.2")
189-
):
190-
array = np.ascontiguousarray(array.astype(np.float64))
191-
else:
192-
vec_dtype = str(getattr(array, "dtype", ""))
193-
array = np.ascontiguousarray(array, dtype=dtypes.get(vec_dtype))
187+
vec_dtype = str(getattr(array, "dtype", ""))
188+
array = np.ascontiguousarray(array, dtype=dtypes.get(vec_dtype))
194189
return array
195190

196191

0 commit comments

Comments
 (0)