woodwork.table_accessor.WoodworkTableAccessor.drop#
- WoodworkTableAccessor.drop(columns, inplace=False)[source]#
Drop specified columns from a DataFrame.
- Parameters:
columns (str or list[str]) – Column name or names to drop. Must be present in the DataFrame.
inplace (bool) – If False, return a copy. Otherwise, do operation inplace and return None.
- Returns:
DataFrame with the specified columns removed, maintaining Woodwork typing information or None if inplace=True. Only possible for pandas dataframes.
- Return type:
DataFrame or None
Note
This method is used for removing columns only. To remove rows with
drop
, go through the DataFrame directly and then reinitialize Woodwork withDataFrame.ww.init
instead of callingDataFrame.ww.drop
.