Detail: SeriesHE: Accessor String
Overview: SeriesHE: Accessor String
- SeriesHE.via_str.__getitem__(key)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.__getitem__(key)[source]
Return a container with the provided selection or slice of each element.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str[-1] <SeriesHE> <Index> a b Z c 3 d <<U1> <<U1>
- SeriesHE.via_str.capitalize
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.capitalize()[source]
Return a container with only the first character of each element capitalized.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.capitalize() <SeriesHE> <Index> a Qrs b Xyz c 123 d wx <<U1> <<U4>
- SeriesHE.via_str.center(width, fillchar)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.center(width, fillchar=' ')[source]
Return a container with its elements centered in a string of length
width
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.center(8) <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U8>
- SeriesHE.via_str.contains(item)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.contains(item)[source]
Return a Boolean container showing True of item is a substring of elements.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.contains('X') <SeriesHE> <Index> a False b True c False d True <<U1> <bool>
- SeriesHE.via_str.count(sub, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.count(sub, start=0, end=None)[source]
Returns a container with the number of non-overlapping occurrences of substring sub in the optional range
start
,end
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.count('X') <SeriesHE> <Index> a 0 b 1 c 0 d 1 <<U1> <int64>
- SeriesHE.via_str.decode(encoding, errors)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.decode(encoding=None, errors=None)[source]
Apply str.decode() to each element. Elements must be bytes.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')).astype(bytes) >>> s <SeriesHE> <Index> a b'qrs ' b b'XYZ' c b'123' d b' wX ' <<U1> <|S4> >>> s.via_str.decode() <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4>
- SeriesHE.via_str.encode(encoding, errors)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.encode(encoding=None, errors=None)[source]
Apply str.encode() to each element. Elements must be strings.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.encode() <SeriesHE> <Index> a b'qrs ' b b'XYZ' c b'123' d b' wX ' <<U1> <|S4>
- SeriesHE.via_str.endswith(suffix, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.endswith(suffix, start=0, end=None)[source]
Returns a container with the number of non-overlapping occurrences of substring
suffix
(or an iterable of suffixes) in the optional rangestart
,end
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.endswith(' ') <SeriesHE> <Index> a True b False c False d True <<U1> <bool>
- SeriesHE.via_str.find(sub, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.find(sub, start=0, end=None)[source]
For each element, return the lowest index in the string where substring
sub
is found.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.find('X') <SeriesHE> <Index> a -1 b 0 c -1 d 2 <<U1> <int64>
- SeriesHE.via_str.format(format)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.format(format)[source]
For each element, return a string resulting from calling the string
format
argument’sformat
method with the the element. Format strings (given within curly braces) can use Python’s format mini language: https://docs.python.org/3/library/string.html#formatspec- Parameters:
format – A string, an iterable of strings, or a mapping of labels to strings. For 1D containers, an iterable of strings must be of length equal to the container; a mapping can use Index labels (for a Series) or positions (for an Index). For 2D containers, an iterable of strings must be of length equal to the columns (for a Frame) or the depth (for an Index Hierarchy); a mapping can use column labels (for a Frame) or depths (for an IndexHierarchy).
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.format('{:-^10}') <SeriesHE> <Index> a ---qrs --- b ---XYZ---- c ---123---- d --- wX --- <<U1> <<U10>
- SeriesHE.via_str.index(sub, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.index(sub, start=0, end=None)[source]
Like
find
, but raisesValueError
when the substring is not found.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.index('X') ValueError('substring not found')
- SeriesHE.via_str.isalnum
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isalnum()[source]
Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isalnum() <SeriesHE> <Index> a False b True c True d False <<U1> <bool>
- SeriesHE.via_str.isalpha
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isalpha()[source]
Returns true for each element if all characters in the string are alphabetic and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isalpha() <SeriesHE> <Index> a False b True c False d False <<U1> <bool>
- SeriesHE.via_str.isdecimal
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isdecimal()[source]
For each element, return True if there are only decimal characters in the element.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isdecimal() <SeriesHE> <Index> a False b False c True d False <<U1> <bool>
- SeriesHE.via_str.isdigit
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isdigit()[source]
Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isdigit() <SeriesHE> <Index> a False b False c True d False <<U1> <bool>
- SeriesHE.via_str.islower
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.islower()[source]
Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.islower() <SeriesHE> <Index> a True b False c False d False <<U1> <bool>
- SeriesHE.via_str.isnumeric
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isnumeric()[source]
For each element in self, return True if there are only numeric characters in the element.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isnumeric() <SeriesHE> <Index> a False b False c True d False <<U1> <bool>
- SeriesHE.via_str.isspace
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isspace()[source]
Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isspace() <SeriesHE> <Index> a False b False c False d False <<U1> <bool>
- SeriesHE.via_str.istitle
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.istitle()[source]
Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.istitle() <SeriesHE> <Index> a False b False c False d False <<U1> <bool>
- SeriesHE.via_str.isupper
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.isupper()[source]
Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.isupper() <SeriesHE> <Index> a False b True c False d False <<U1> <bool>
- SeriesHE.via_str.ljust(width, fillchar)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.ljust(width, fillchar=' ')[source]
Return a container with its elements ljusted in a string of length
width
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.ljust(8) <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U8>
- SeriesHE.via_str.len
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.len()[source]
Return the length of the string.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.len() <SeriesHE> <Index> a 4 b 3 c 3 d 4 <<U1> <int64>
- SeriesHE.via_str.lower
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.lower()[source]
Return an array with the elements of self converted to lowercase.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.lower() <SeriesHE> <Index> a qrs b xyz c 123 d wx <<U1> <<U4>
- SeriesHE.via_str.lstrip(chars)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.lstrip(chars=None)[source]
For each element, return a copy with the leading characters removed.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.lstrip() <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4>
- SeriesHE.via_str.partition(sep)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.partition(sep)[source]
Partition each element around
sep
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.partition('X') <SeriesHE> <Index> a (np.str_('qrs '),... b ('', 'X', 'YZ') c (np.str_('123'), ... d (' w', 'X', ' ') <<U1> <object>
- SeriesHE.via_str.replace(old, new, count)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.replace(old, new, count=-1)[source]
Return a container with its elements replaced in a string of length
width
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.replace('X', '*') <SeriesHE> <Index> a qrs b *YZ c 123 d w* <<U1> <<U4>
- SeriesHE.via_str.rfind(sub, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rfind(sub, start=0, end=None)[source]
For each element, return the highest index in the string where substring
sub
is found, such that sub is contained withinstart
,end
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rfind('X') <SeriesHE> <Index> a -1 b 0 c -1 d 2 <<U1> <int64>
- SeriesHE.via_str.rindex(sub, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rindex(sub, start=0, end=None)[source]
Like
rfind
, but raisesValueError
when the substringsub
is not found.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rindex('X') ValueError('substring not found')
- SeriesHE.via_str.rjust(width, fillchar)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rjust(width, fillchar=' ')[source]
Return a container with its elements rjusted in a string of length
width
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rjust(8) <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U8>
- SeriesHE.via_str.rpartition(sep)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rpartition(sep)[source]
Partition (split) each element around the right-most separator.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rpartition('X') <SeriesHE> <Index> a ('', '', np.str_(... b ('', 'X', 'YZ') c ('', '', np.str_(... d (' w', 'X', ' ') <<U1> <object>
- SeriesHE.via_str.rsplit(sep, maxsplit)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rsplit(sep, maxsplit=-1)[source]
For each element, return a tuple of the words in the string, using sep as the delimiter string.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rsplit('X') <SeriesHE> <Index> a ('qrs ',) b ('', 'YZ') c ('123',) d (' w', ' ') <<U1> <object>
- SeriesHE.via_str.rstrip(chars)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.rstrip(chars=None)[source]
For each element, return a copy with the trailing characters removed.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.rstrip() <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4>
- SeriesHE.via_str.split(sep, maxsplit)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.split(sep, maxsplit=-1)[source]
For each element, return a tuple of the words in the string, using sep as the delimiter string.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.split('X') <SeriesHE> <Index> a ('qrs ',) b ('', 'YZ') c ('123',) d (' w', ' ') <<U1> <object>
- SeriesHE.via_str.startswith(prefix, start, end)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.startswith(prefix, start=0, end=None)[source]
Returns a container with the number of non-overlapping occurrences of substring prefix (or an iterable of prefixes) in the optional range
start
,end
.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.startswith('X') <SeriesHE> <Index> a False b True c False d False <<U1> <bool>
- SeriesHE.via_str.strip(chars)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.strip(chars=None)[source]
For each element, return a copy with the leading and trailing characters removed.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.strip() <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4>
- SeriesHE.via_str.swapcase
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.swapcase()[source]
Return a container with uppercase characters converted to lowercase and vice versa.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.swapcase() <SeriesHE> <Index> a QRS b xyz c 123 d Wx <<U1> <<U4>
- SeriesHE.via_str.title
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.title()[source]
Return a container with uppercase characters converted to lowercase and vice versa.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.title() <SeriesHE> <Index> a Qrs b Xyz c 123 d Wx <<U1> <<U4>
- SeriesHE.via_str.upper
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.upper()[source]
Return a container with uppercase characters converted to lowercase and vice versa.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.upper() <SeriesHE> <Index> a QRS b XYZ c 123 d WX <<U1> <<U4>
- SeriesHE.via_str.zfill(width)
- SeriesHE.via_str
Interface for applying string methods to elements in this container.
- InterfaceString.zfill(width)[source]
Return the string left-filled with zeros.
>>> s = sf.SeriesHE(('qrs ', 'XYZ', '123', ' wX '), index=('a', 'b', 'c', 'd')) >>> s <SeriesHE> <Index> a qrs b XYZ c 123 d wX <<U1> <<U4> >>> s.via_str.zfill(8) <SeriesHE> <Index> a 0000qrs b 00000XYZ c 00000123 d 0000 wX <<U1> <<U8>
SeriesHE: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Assignment | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic | Accessor Mapping