order_for

order_for(var)

Find the order that applies to a variable.

Looks up the registered order for a column: an exact vars match wins, otherwise the first matching prefixes entry. Used internally by calc_percentage() to apply orders automatically; exposed so you can check what would be applied.

Parameters

Name Type Description Default
var str A column name. required

Returns

Name Type Description
list of str or None The matching levels, or None if none is registered.

See Also

register_order, apply_order

Examples

>>> register_order("edu", ["low", "mid", "high"], prefixes="edu_")
>>> order_for("edu_level")
>>> remove_order("edu")