Skip to content

Get a formatted version of the output DataType

Source code

Description

[Experimental] Get a formatted version of the output DataType.

Usage

<DataTypeExpr>$display()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(x = 1:2, y = c("a", "b"), z = c(1, 2))
df$select(
  x = pl$dtype_of("x")$display(),
  y = pl$dtype_of("y")$display(),
  z = pl$dtype_of("z")$display(),
)$transpose(include_header = TRUE)
#> shape: (3, 2)
#> ┌────────┬──────────┐
#> │ column ┆ column_0 │
#> │ ---    ┆ ---      │
#> │ str    ┆ str      │
#> ╞════════╪══════════╡
#> │ x      ┆ i32      │
#> │ y      ┆ str      │
#> │ z      ┆ f64      │
#> └────────┴──────────┘