with_subroles

DataFrame.with_subroles(cols, subroles, append=True)[source]

Returns a new view with one or several new subroles on one or more columns.

The difference between with_subroles() and set_subroles() is that with_subroles() returns a view that is lazily evaluated when needed whereas set_subroles() is an in-place operation. From a memory perspective, in-place operations like set_subroles() are preferable.

Args:
cols (str, FloatColumn, StingColumn, or List[str, FloatColumn, StringColumn]):

The columns or the names thereof.

subroles (str or List[str]):

The subroles to be assigned.

append (bool, optional):

Whether you want to append the new subroles to the existing subroles.