vastorbit.VastColumn.str_slice¶
- VastColumn.str_slice(start: int, step: int) VastFrame¶
Slices the VastColumn. The VastColumn will be transformed.
- Parameters:
start (int) – Start of the slicing (1-indexed).
step (int) – Size of the slicing.
- Returns:
self._parent
- Return type:
Examples
Let’s begin by importing vastorbit.
import vastorbit as vo
Let’s generate a small dataset using the following data:
data = vo.VastFrame( { "name": [ 'Mr. Steve Smith', 'Mr. Charlie Dickens', 'Mrs. Helen Ross', 'Dr. Jack Smith', ] } )
Let’s extract the first 3 characters of name.
data["name"].str_slice(start = 1, step = 3)
AbcnameVarchar(19)1 Mr 2 Mr 3 Mr 4 Dr Rows: 1-4 | Column: name | Type: varchar(19)See also
VastFrame.str_contains(): Validates the regular expression.VastFrame.str_count(): Counts occurrences matching the regular expression.VastFrame.str_replace(): Replaces the Regular Expression.VastFrame.str_extract(): Extracts the Regular Expression.