norm#

pymovements.transforms.norm(column: str | None = None, *, components: tuple[int, int] | tuple[str, str] = (0, 1), columns: tuple[str, str] | None = None) Expr[source]#

Take the norm of a 2D series.

The norm is defined by \(\sqrt{x^2 + y^2}\) with \(x\) being the yaw component and \(y\) being the pitch component of a coordinate.

Parameters:
  • column (str | None) – Take the norm of the components of this column with nested data (list or struct). This argumment is mutually exclusive with the columns argument. (default: None)

  • components (tuple[int, int] | tuple[str, str]) – If column is provided, take the norm of these two components in the specified nested column. If the tuple elements are of type int the nested column dtype is to be assumed as polars.List and child elements with that indices are used for taking the norm. If the tuple elements are of type str the nested column dtype is to be assumed as polars.Struct and the fields with these names are used for taking the norm. (default: (0, 1))

  • columns (tuple[str, str] | None) – Two columns to take the norm of. This is mutually exclusive with the column argument. (default: None)

Returns:

The respective polars expression.

Return type:

pl.Expr