Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

# enum_ module

Enum utilities.

In vectorbt, enums are represented by instances of named tuples to be easily used in Numba. Their values start with 0, while -1 means there is no value.

## map_enum_fields function

    map_enum_fields(
        field,
        enum,
        enum_unkval=-1,
        ignore_type=builtins.int,
        **kwargs
    )

Map fields to values.

See apply_mapping().

## map_enum_values function

    map_enum_values(
        value,
        enum,
        enum_unkval=-1,
        ignore_type=builtins.str,
        **kwargs
    )

Map values to fields.

See apply_mapping().

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings