diff --git a/clouddrift/adapters/gdp/__init__.py b/clouddrift/adapters/gdp/__init__.py index e692aea3..6cd38b6c 100644 --- a/clouddrift/adapters/gdp/__init__.py +++ b/clouddrift/adapters/gdp/__init__.py @@ -269,7 +269,7 @@ def str_to_float(value: str, default: float = np.nan) -> float: return default -def cut_str(value: str, max_length: int) -> np.chararray: +def cut_str(value: str, max_length: int) -> np.char.chararray: """Cut a string to a specific length and return it as a numpy chararray. Parameters @@ -284,7 +284,7 @@ def cut_str(value: str, max_length: int) -> np.chararray: out : np.chararray String with max_length characters """ - charar = np.chararray(1, max_length) + charar = np.char.chararray(1, max_length) charar[:max_length] = value return charar