Skip to content

Expr.Name (NameOps) ​

Namespace: Polars.CSharp

Offers methods for renaming columns.

Instance Methods ​

Keep ​

Keep the original root name of the expression.

csharp
public Expr Keep()

Map ​

Rename the output of an expression by mapping a function over the root name.

csharp
public Expr Map(Func<string, string> function)

Parameters

NameTypeDescription
functionFunc<string, string>Function that maps a root name to a new name.

MapFields ​

Rename fields of a struct by mapping a function over the field name(s).

csharp
public Expr MapFields(Func<string, string> function)

Parameters

NameTypeDescription
functionFunc<string, string>Function that maps a field name to a new name.

Prefix ​

Prefix the column name with a specified string.

csharp
public Expr Prefix(string prefix)

Parameters

NameTypeDescription
prefixstring-

PrefixFields ​

Add a prefix to all field names of a struct.

csharp
public Expr PrefixFields(string prefix)

Parameters

NameTypeDescription
prefixstringPrefix to add to the field name.

Replace ​

Replace matching regex/literal substring in the name with a new value.

csharp
public Expr Replace(string pattern, string value, bool literal = false)

Parameters

NameTypeDescription
patternstringA valid regular expression pattern, compatible with the regex crate.
valuestringString that will replace the matched substring.
literalboolTreat pattern as a literal string, not a regex.

Suffix ​

Suffix the column name with a specified string.

csharp
public Expr Suffix(string suffix)

Parameters

NameTypeDescription
suffixstring-

SuffixFields ​

Add a suffix to all field names of a struct.

csharp
public Expr SuffixFields(string suffix)

Parameters

NameTypeDescription
suffixstringSuffix to add to the field name.

ToLowercase ​

Make the root column name lowercase.

csharp
public Expr ToLowercase()

ToUppercase ​

Make the root column name uppercase.

csharp
public Expr ToUppercase()

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