categoricalWhen

fnSeries categoricalWhen(Series mask, Series a, Series b) @trusted

The elementwise select for categorical branches (the when contract of ADR-2026-10-23-08: a null mask slot reads null; the selected branch's null stays null; the output carries one shared dictionary - both branches reconcile onto it first).

Parameters

maskthe BOOLEAN selector
athe true branch (CATEGORICAL)
bthe false branch (CATEGORICAL, same dtype)

Returns

the selected CATEGORICAL Series.