RemoveRowsOp

class RemoveRowsOp(parameters)[source]

Remove rows from a columnar file based on the values in a specified row.

Required remodeling parameters:
  • column_name (str): The name of column to be tested.

  • remove_values (list): The values to test for row removal.

Methods

RemoveRowsOp.__init__(parameters)

Constructor for remove rows operation.

RemoveRowsOp.do_op(dispatcher, df, name[, ...])

Remove rows with the values indicated in the column.

RemoveRowsOp.validate_input_data(parameters)

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

Attributes

RemoveRowsOp.NAME

RemoveRowsOp.PARAMS

RemoveRowsOp.__init__(parameters)[source]

Constructor for remove rows operation.

Parameters:

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

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

Remove rows with the values indicated in the column.

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

static RemoveRowsOp.validate_input_data(parameters)[source]

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

RemoveRowsOp.NAME = 'remove_rows'
RemoveRowsOp.PARAMS = {'additionalProperties': False, 'properties': {'column_name': {'description': 'Name of the key column to determine which rows to remove.', 'type': 'string'}, 'remove_values': {'description': 'List of key values for rows to remove.', 'items': {'type': ['string', 'number']}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['column_name', 'remove_values'], 'type': 'object'}