TimeFrame.decode_flag_column

TimeFrame.decode_flag_column(flag_column_name)[source]

Decode a flag column from raw values to human-readable flag names.

For BitwiseFlagColumn: replaces the integer column with a List(String) column of active flag names, sorted by ascending bit value. A value of 0 produces an empty list.

For CategoricalFlagColumn in scalar mode: replaces each raw value with its flag name (e.g. 123 -> "good"), producing a Utf8 column.

For CategoricalFlagColumn in list mode: replaces each value in the list with its flag name, producing a List(Utf8) column.

The column remains registered as a flag column. add_flag and remove_flag continue to work transparently on the decoded column.

Parameters:

flag_column_name (str) – Name of the registered flag column to decode.

Return type:

TimeFrame

Returns:

A new TimeFrame with the flag column replaced by its decoded form.

Raises:
  • ColumnNotFoundError – If flag_column_name is not a registered flag column.

  • ColumnTypeError – If the flag column is already in decoded form.