FactorHedTypeOp¶
- class FactorHedTypeOp(parameters)[source]
Create tabular file factors from type variables and append to tabular data.
- Required remodeling parameters:
type_tag (str): HED tag used to find the factors (most commonly condition-variable).
type_values (list): Factor values to include. If empty all values of that type_tag are used.
Methods
|
Constructor for the factor HED type operation. |
|
Verify that the parameters meet the operation specification. |
|
Factor columns based on HED type and append to tabular data. |
Attributes
|
- FactorHedTypeOp.__init__(parameters)[source]¶
Constructor for the factor HED type operation.
- Parameters:
parameters (dict) – Actual values of the parameters for the operation.
- Raises:
KeyError –
If a required parameter is missing.
If an unexpected parameter is provided.
TypeError –
If a parameter has the wrong type.
ValueError –
If the specification is missing a valid operation.
- FactorHedTypeOp.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.
- FactorHedTypeOp.do_op(dispatcher, df, name, sidecar=None)[source]¶
Factor columns based on HED type and append to tabular data.
- 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) – Only needed for HED operations.
- Returns:
A new DataFame with that includes the factors.
- Return type:
DataFrame
Notes
If column_name is not a column in df, df is just returned.
- FactorHedTypeOp.PARAMS = {'operation': 'factor_hed_type', 'optional_parameters': {}, 'required_parameters': {'type_tag': <class 'str'>, 'type_values': <class 'list'>}}¶