bach.SeriesString.str
property str
: bach.series.series_string.StringOperation
Get access to string operations.
class StringOperation
(base)lower
()converts string values into lowercase.
Returns
SeriesString with all alphabetic characters in lowercase
replace
(pat, repl, n=- 1, case=None, flags=0, regex=False)replace each occurrence of a pattern in SeriesString.
Parameters
pat
– string or compiled pattern to use for replacement.repl
– string to use as a replacement for each occurrencen
– number of occurrences to be replaced. Only n=-1 is supported (all occurrences)case
– determines if the replace is case insensitive. Considered only when regex=True.flags
– regex module flags. Considered only when regex=True.regex
– Determines if provided pattern is a regular expression or not.
note
Replacements based on regular expressions are not supported yet. Therefore:
* `pat` parameter must be string type
* `case`, `flags`, `regex` will not be considered on replacement
slice
(start=None, stop=None)slice a string like you would in Python, either by calling this method, or by slicing directly
on the str
accessor.
a.str[3] # get one char
a.str[3:5] # get a slice from char 3-5
a.str.slice(3, 5) # idem