Skip to content

Rechunk memory layout

Source code

Description

Create a single chunk of memory for this Series.

Usage

<Expr>$rechunk()

Details

See rechunk() explained here docs_translations.

Value

Expr

Examples

library("polars")

# get chunked lengths with/without rechunk
series_list = pl$DataFrame(list(a = 1:3, b = 4:6))$select(
  pl$col("a")$append(pl$col("b"))$alias("a_chunked"),
  pl$col("a")$append(pl$col("b"))$rechunk()$alias("a_rechunked")
)$get_columns()
lapply(series_list, \(x) x$chunk_lengths())
#> [[1]]
#> [1] 3 3
#> 
#> [[2]]
#> [1] 6