RemoveColumnsOp

class RemoveColumnsOp(parameters)[source]

Remove columns from a columnar file.

Required remodeling parameters:
  • column_names (list): The names of the columns to be removed.

  • ignore_missing (boolean): If True, names in column_names that are not columns in df should be ignored.

Methods

RemoveColumnsOp.__init__(parameters)

Constructor for remove columns operation.

RemoveColumnsOp.do_op(dispatcher, df, name)

Remove indicated columns from a dataframe.

RemoveColumnsOp.validate_input_data(parameters)

Additional validation required of operation parameters not performed by JSON schema validator.

Attributes

RemoveColumnsOp.NAME

RemoveColumnsOp.PARAMS

RemoveColumnsOp.__init__(parameters)[source]

Constructor for remove columns operation.

Parameters:

parameters (dict) – Dictionary with the parameter values for required and optional parameters.

RemoveColumnsOp.do_op(dispatcher, df, name, sidecar=None)[source]

Remove indicated columns from a dataframe.

Parameters:
  • dispatcher (Dispatcher) – Manages the operation I/O.

  • df (DataFrame) – The DataFrame to be remodeled.

  • name (str) – Unique identifier for the dataframe – often the original file path.

  • sidecar (Sidecar or file-like) – Not needed for this operation.

Returns:

A new dataframe after processing.

Return type:

Dataframe

Raises:

KeyError

  • If ignore_missing is False and a column not in the data is to be removed.

static RemoveColumnsOp.validate_input_data(parameters)[source]

Additional validation required of operation parameters not performed by JSON schema validator.

RemoveColumnsOp.NAME = 'remove_columns'
RemoveColumnsOp.PARAMS = {'additionalProperties': False, 'properties': {'column_names': {'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, 'ignore_missing': {'type': 'boolean'}}, 'required': ['column_names', 'ignore_missing'], 'type': 'object'}