ak.categories — Awkward Array documentation

# ak.categories

Defined in awkward.behaviors.categorical on line 135.

ak.categories(array, highlevel=True)
  Parameters:

    - array – A possibly-categorical Awkward Array.

    - highlevel (bool) – If True, return an `ak.Array`; otherwise, return a low-level `ak.layout.Content` subclass.

If the `array` is categorical (contains `ak.layout.IndexedArray` or `ak.layout.IndexedOptionArray` labeled with parameter `"__array__" = "categorical"`), then this function returns its categories.

See also `ak.is_categorical`, `ak.to_categorical`, `ak.from_categorical`.