Skip to content

Compute the dot/inner product between two Expressions

Description

Compute the dot/inner product between two Expressions

Usage

<Expr>$dot(other)

Arguments

other Expression to compute dot product with.

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(a = c(1, 3, 5), b = c(2, 4, 6))
df$select(pl$col("a")$dot(pl$col("b")))
#> shape: (1, 1)
#> ┌──────┐
#> │ a    │
#> │ ---  │
#> │ f64  │
#> ╞══════╡
#> │ 44.0 │
#> └──────┘