String#

The following methods are available under the Series.str attribute.

Series.str.concat([delimiter])

Vertically concat the values in the Series to a single string value.

Series.str.contains(pattern, *[, literal, ...])

Check if strings in Series contain a substring that matches a regex.

Series.str.count_match(pattern)

Count all successive non-overlapping regex matches.

Series.str.decode(encoding, *[, strict])

Decode a value using the provided encoding.

Series.str.encode(encoding)

Encode a value using the provided encoding.

Series.str.ends_with(suffix)

Check if string values end with a substring.

Series.str.explode()

Returns a column with a separate row for every string character.

Series.str.extract(pattern[, group_index])

Extract the target capture group from provided patterns.

Series.str.extract_all(pattern)

Extract all matches for the given regex pattern.

Series.str.extract_groups(pattern)

Extract all capture groups for the given regex pattern.

Series.str.json_extract([dtype, ...])

Parse string values as JSON.

Series.str.json_path_match(json_path)

Extract the first match of json string with provided JSONPath expression.

Series.str.lengths()

Get length of the string values in the Series (as number of bytes).

Series.str.ljust(width[, fill_char])

Return the string left justified in a string of length width.

Series.str.lstrip([characters])

Remove leading characters.

Series.str.n_chars()

Get length of the string values in the Series (as number of chars).

Series.str.replace(pattern, value, *[, ...])

Replace first matching regex/literal substring with a new string value.

Series.str.replace_all(pattern, value, *[, ...])

Replace all matching regex/literal substrings with a new string value.

Series.str.rjust(width[, fill_char])

Return the string right justified in a string of length width.

Series.str.rstrip([characters])

Remove trailing characters.

Series.str.slice(offset[, length])

Create subslices of the string values of a Utf8 Series.

Series.str.split(by, *[, inclusive])

Split the string by a substring.

Series.str.split_exact(by, n, *[, inclusive])

Split the string by a substring using n splits.

Series.str.splitn(by, n)

Split the string by a substring, restricted to returning at most n items.

Series.str.starts_with(prefix)

Check if string values start with a substring.

Series.str.strip([characters])

Remove leading and trailing characters.

Series.str.strptime(dtype[, format, strict, ...])

Convert a Utf8 column into a Date/Datetime/Time column.

Series.str.to_date([format, strict, exact, ...])

Convert a Utf8 column into a Date column.

Series.str.to_datetime([format, time_unit, ...])

Convert a Utf8 column into a Datetime column.

Series.str.to_decimal([inference_length])

Convert a Utf8 column into a Decimal column.

Series.str.to_lowercase()

Modify the strings to their lowercase equivalent.

Series.str.to_time([format, strict, cache])

Convert a Utf8 column into a Time column.

Series.str.to_titlecase()

Modify the strings to their titlecase equivalent.

Series.str.to_uppercase()

Modify the strings to their uppercase equivalent.

Series.str.zfill(alignment)

Fills the string with zeroes.

Series.str.parse_int([radix, strict])

Parse integers with base radix from strings.