Skip to content

kxi.sp.string

to_uppercase

@StringOperator
def to_uppercase(
        field: Union[str, List[str], int, List[int]]) -> StringOperator

Transform fields containing lists of strings to uppercase.

Arguments:

  • field - a list of column names or a list of indices, corresponding to one of the following: a string a list of strings an index list of indexes A field represents a incoming stream of data. This can be any string data ex database entries

Returns:

A pipeline comprised of a 'to_uppercase' operator, which can be joined to other pipelines.

Transforms string columns to uppercase

     sp.run(sp.read.from_expr('([] x: til 5; y: ("Records"; "Name"; "AGE"; "JOB"; "owner"))')
       | sp.string.to_uppercase('y')
       | sp.write.to_variable('out', VariableMode.overwrite))
([] x: til 5; y: upper ("Records"; "Name"; "AGE"; "JOB"; "owner"))

to_lowercase

@StringOperator
def to_lowercase(
        field: Union[str, List[str], int, List[int]]) -> StringOperator

Transform fields containing lists of strings to lowercase.

Arguments:

  • field - a list of column names or a list of indices, corresponding to one of the following: a string a list of strings an index list of indexes A field represents a incoming stream of data. This can be any string data ex database entries

Returns:

A pipeline comprised of a 'to_lowercase' operator, which can be joined to other pipelines.

Transforms string columns to lowercase

     sp.run(sp.read.from_expr('([] x: til 5; y: ("Records"; "Name"; "AGE"; "JOB"; "owner"))')
       | sp.string.to_lowercase('y')
       | sp.write.to_variable('out', VariableMode.overwrite))
([] x: til 5; y: lower ("Records"; "Name"; "AGE"; "JOB"; "owner"))