RemoveRowsOp

class RemoveRowsOp(parameters)[source]

Remove rows from a tabular file.

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

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

Methods

hed.tools.remodeling.operations.remove_rows_op.RemoveRowsOp.__init__(...)

Constructor for remove rows operation.

hed.tools.remodeling.operations.remove_rows_op.RemoveRowsOp.check_parameters(...)

Verify that the parameters meet the operation specification.

hed.tools.remodeling.operations.remove_rows_op.RemoveRowsOp.do_op(...)

Remove rows with the values indicated in the column.

Attributes

hed.tools.remodeling.operations.remove_rows_op.RemoveRowsOp.PARAMS

RemoveRowsOp.__init__(parameters)[source]

Constructor for remove rows operation.

Parameters:

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

Raises:
  • KeyError

    • If a required parameter is missing.

    • If an unexpected parameter is provided.

  • TypeError

    • If a parameter has the wrong type.

RemoveRowsOp.check_parameters(parameters)

Verify that the parameters meet the operation specification.

Parameters:

parameters (dict) – Dictionary of parameters for this operation.

Raises:
  • KeyError

    • If a required parameter is missing.

    • If an unexpected parameter is provided.

  • TypeError

    • If a parameter has the wrong type.

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

RemoveRowsOp.PARAMS = {'operation': 'remove_rows', 'optional_parameters': {}, 'required_parameters': {'column_name': <class 'str'>, 'remove_values': <class 'list'>}}