Get the DataFrame as a List of Series
Description
Get the DataFrame as a List of Series
Usage
<DataFrame>$get_columns()
Value
A list of Series
See Also
-
\
: Similar to this method but returns a list of vectors instead of Series.$to_list()
Examples
#> [[1]]
#> polars Series: shape: (3,)
#> Series: 'foo' [i32]
#> [
#> 1
#> 2
#> 3
#> ]
#>
#> [[2]]
#> polars Series: shape: (3,)
#> Series: 'bar' [i32]
#> [
#> 4
#> 5
#> 6
#> ]
df = pl$DataFrame(
a = 1:4,
b = c(0.5, 4, 10, 13),
c = c(TRUE, TRUE, FALSE, TRUE)
)
df$get_columns()
#> [[1]]
#> polars Series: shape: (4,)
#> Series: 'a' [i32]
#> [
#> 1
#> 2
#> 3
#> 4
#> ]
#>
#> [[2]]
#> polars Series: shape: (4,)
#> Series: 'b' [f64]
#> [
#> 0.5
#> 4.0
#> 10.0
#> 13.0
#> ]
#>
#> [[3]]
#> polars Series: shape: (4,)
#> Series: 'c' [bool]
#> [
#> true
#> true
#> false
#> true
#> ]