ak.strings_astype ----------------- .. py:module: ak.strings_astype Defined in `awkward.operations.ak_strings_astype `__ on `line 18 `__. .. py:function:: ak.strings_astype(array, to, *, highlevel=True, behavior=None, attrs=None) :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes). :param to: Type to convert the strings into. :type to: dtype or dtype specifier :param highlevel: If True, return an :py:obj:`ak.Array`; otherwise, return a low-level :py:obj:`ak.contents.Content` subclass. :type highlevel: bool :param behavior: Custom :py:obj:`ak.behavior` for the output array, if high-level. :type behavior: None or dict :param attrs: Custom attributes for the output array, if high-level. :type attrs: None or dict Converts all strings in the array to a new type, leaving the structure untouched. For example, .. code-block:: python >>> array = ak.Array(["1", "2", " 3 ", "00004", "-5"]) >>> ak.strings_astype(array, np.int32) and .. code-block:: python >>> array = ak.Array(["1.1", "2.2", " 3.3 ", "00004.4", "-5.5"]) >>> ak.strings_astype(array, np.float64) and finally, .. code-block:: python >>> array = ak.Array([["1.1", "2.2", " 3.3 "], [], ["00004.4", "-5.5"]]) >>> ak.strings_astype(array, np.float64) See also :py:obj:`ak.numbers_astype`.