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()
andset_subroles()
is thatwith_subroles()
returns a view that is lazily evaluated when needed whereasset_subroles()
is an in-place operation. From a memory perspective, in-place operations likeset_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.