Skip to content

Drop in place

Source code

Description

Drop a single column in-place and return the dropped column.

Usage

<DataFrame>$drop_in_place(name)

Arguments

name string Name of the column to drop.

Value

Series

Examples

library("polars")

dat = as_polars_df(iris)
x = dat$drop_in_place("Species")
x
#> polars Series: shape: (150,)
#> Series: 'Species' [cat]
#> [
#>  "setosa"
#>  "setosa"
#>  "setosa"
#>  "setosa"
#>  "setosa"
#>  …
#>  "virginica"
#>  "virginica"
#>  "virginica"
#>  "virginica"
#>  "virginica"
#> ]
dat$columns
#> [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"