cudf.core.column.string.StringMethods.slice_from#
- StringMethods.slice_from(starts: cudf.Series, stops: cudf.Series) SeriesOrIndex #
Return substring of each string using positions for each string.
The starts and stops parameters are of Column type.
- Parameters
- startsSeries
Beginning position of each the string to extract. Default is beginning of the each string.
- stopsSeries
Ending position of the each string to extract. Default is end of each string. Use -1 to specify to the end of that string.
- Returns
- Series/Index of str dtype
A substring of each string using positions for each string.
Examples
>>> import cudf >>> s = cudf.Series(["hello","there"]) >>> s 0 hello 1 there dtype: object >>> starts = cudf.Series([1, 3]) >>> stops = cudf.Series([5, 5]) >>> s.str.slice_from(starts, stops) 0 ello 1 re dtype: object