string
StringMethods ¶
Class that provides string methods to series.
Parameters:
-
series
(Series
) –Series to be used.
len ¶
Return a series containing the length of each string.
Applies LEN operator to column.
Returns:
-
Series
–A series containing the length of each string.
lower ¶
Return a series with all strings converted to lowercase.
Applies LOWER operator to column.
Returns:
-
Series
–A series with all strings converted to lowercase.
upper ¶
Return a series with all strings converted to uppercase.
Applies UPPER operator to column.
Returns:
-
Series
–A series with all strings converted to uppercase.
lstrip ¶
Return a series with leading whitespace removed from each string.
Applies LTRIM operator to column.
Returns:
-
Series
–A series with leading whitespace removed from each string.
rstrip ¶
Return a series with trailing whitespace removed from each string.
Applies RTRIM operator to column.
Returns:
-
Series
–A series with trailing whitespace removed from each string.
strip ¶
Return a series with leading and trailing whitespace removed from each string.
Applies RTRIM operator and LTRIM operator to column.
Returns:
-
Series
–A series with leading and trailing whitespace removed from each string.
startswith ¶
Return a boolean series indicating if each string starts with the specified pattern.
Applies LIKE operator to column.
Parameters:
-
pattern
(str
) –The string pattern to check.
Returns:
-
Series
–A boolean series indicating if each string starts with the specified pattern.
endswith ¶
Return a boolean series indicating if each string ends with the specified pattern.
Applies LIKE operator to column.
Parameters:
-
pattern
(str
) –The string pattern to check.
Returns:
-
Series
–A boolean series indicating if each string ends with the specified pattern.
contains ¶
Return a boolean series indicating if the input pattern is contained in each string.
Applies LIKE operator to column.
Parameters:
-
pattern
(str
) –String pattern to search for.
Returns:
-
Series
–A boolean series indicating if the pattern is contained in each string.
replace ¶
Return a series with all occurrences of to_replace replaced by the replacement value.
Applies REPLACE operator to column.
Parameters:
-
to_replace
(Union[Series, ScalarValue]
) –The string pattern to search for.
-
value
(Union[Series, ScalarValue]
) –The string to replace to_replace with.
Returns:
-
Series
–A series with all occurrences of search_pattern replaced by the replacement string.