Skip to content

Expr.Cat (CategoricalOps) ​

Namespace: Polars.CSharp

Operations on Catgorical columns. Access via Expr.Cat.

Instance Methods ​

EndsWith ​

Check if string representations of values end with a substring.

csharp
public Expr EndsWith(string suffix)

Parameters

NameTypeDescription
suffixstringSuffix substring.

GetCategories ​

Get the categories stored in this data type.

csharp
public Expr GetCategories()

LenBytes ​

Return the byte-length of the string representation of each value.

csharp
public Expr LenBytes()

Returns: Expression/Series of data type UInt32.


LenChars ​

Return the number of characters of the string representation of each value.

csharp
public Expr LenChars()

Returns: Expression/Series of data type UInt32.


Physical ​

Get the physical values of a categorical or enum data type.

csharp
public Expr Physical()

StartsWith ​

Check if string representations of values start with a substring.

csharp
public Expr StartsWith(string prefix)

Parameters

NameTypeDescription
prefixstringPrefix substring.

To ​

Convert to a categorical or enum dtype. The input must be of the physical type of the categorical or enum dtype.

csharp
public Expr To(IntoDataTypeExpr dtype, bool strict = true)

Parameters

NameTypeDescription
dtypeIntoDataTypeExprThe target categorical or enum dtype.
strictboolWhether to panic when encountering an illegal category.

Released under the MIT License. Powered by the Polars Rust core & Apache Arrow.