Skip to content

Get column (as one Series)

Source code

Description

Extract a DataFrame column as a Polars series.

Usage

<DataFrame>$get_column(name)

Arguments

name Name of the column to extract.

Value

Series

Examples

library("polars")

df = as_polars_df(iris[1:2, ])
df$get_column("Species")
#> polars Series: shape: (2,)
#> Series: 'Species' [cat]
#> [
#>  "setosa"
#>  "setosa"
#> ]