Skip to content

Check if the Series is numeric

Source code

Description

This checks whether the Series DataType is in pl$numeric_dtypes.

Usage

<Series>$is_numeric()

Value

A logical value

Examples

library("polars")

as_polars_series(1:4)$is_numeric()
#> [1] TRUE
as_polars_series(c("a", "b", "c"))$is_numeric()
#> [1] FALSE
pl$numeric_dtypes
#> $Int8
#> DataType: Int8
#> 
#> $Int16
#> DataType: Int16
#> 
#> $Int32
#> DataType: Int32
#> 
#> $Int64
#> DataType: Int64
#> 
#> $Float32
#> DataType: Float32
#> 
#> $Float64
#> DataType: Float64