@classmethod<EOL><INDENT>def apply(cls, x, palette, na_value=None):<DEDENT>
limits = cls.train(x)<EOL>return cls.map(x, palette, limits, na_value)<EOL>
Scale data discretely

Parameters
----------
x : array_like
    Discrete values to scale
palette : callable ``f(x)``
    Palette to use
na_value : object
    Value to use for missing values.

Returns
-------
out : array_like
    Scaled values