diff --git a/pygmt/helpers/utils.py b/pygmt/helpers/utils.py index 5b4bb731baa..5004e1b24cf 100644 --- a/pygmt/helpers/utils.py +++ b/pygmt/helpers/utils.py @@ -172,6 +172,11 @@ def is_nonstr_iter(value): True >>> is_nonstr_iter((1, 2, 3)) True + >>> import numpy as np + >>> is_nonstr_iter(np.array([1.0, 2.0, 3.0])) + True + >>> is_nonstr_iter(np.array(["abc", "def", "ghi"])) + True """ return isinstance(value, Iterable) and not isinstance(value, str)