neuralset.events.transforms.basic.CreateColumn

pydantic model neuralset.events.transforms.basic.CreateColumn[source][source]

Create a new column with a default value, and optionally update selected rows via a query.

Parameters:
  • column (str) – Name of the column to create.

  • query_row (Query) – A pandas query string to select rows to update (see base.Query).

  • default_value (Any) – Default value to assign to all rows. If None, the column will not be initialized and only the rows selected by the query will be assigned the values from the query_column_name column.

  • query_value (Any) – Value to assign to rows selected by the query.

  • query_column_name (str | None) – If provided instead of query_value, the rows selected by the query will be assigned the values from this column.

  • on_column_exists (Literal["raise", "warn", "ignore"]) – Behavior if the column already exists.

Fields:
field column: str [Required][source]
field query_row: Annotated[str, AfterValidator(func=validate_query)] [Required][source]
field default_value: Any = None[source]
field query_value: Any = None[source]
field query_column_name: str | None = None[source]
field on_column_exists: Literal['raise', 'warn', 'ignore'] = 'raise'[source]
requirements: tp.ClassVar[tuple[str, ...]] = ()[source]