ak.categories ------------- .. py:module: ak.categories Defined in `awkward.operations.ak_categories `__ on `line 13 `__. .. py:function:: ak.categories(array, highlevel=True, *, behavior=None, attrs=None) :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes). :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 If the ``array`` is categorical (contains :py:obj:`ak.contents.IndexedArray` or :py:obj:`ak.contents.IndexedOptionArray` labeled with parameter ``"__array__" = "categorical"``), then this function returns its categories. See also :py:obj:`ak.is_categorical`, :py:obj:`ak.str.to_categorical`, :py:obj:`ak.from_categorical`.