Detail: Frame: Accessor String

Overview: Frame: Accessor String

Frame.via_str.__getitem__(key)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str[-1]
<Frame: x>
<Index>    a     b     <<U1>
<Index>
p          0
q          2     Z
r          8     3
s          3
<<U1>      <<U1> <<U1>
Frame.via_str.capitalize
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.capitalize()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     Qrs
q          2      Xyz
r          8      123
s          3       wx
<<U1>      <<U21> <<U4>
Frame.via_str.center(width, fillchar)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.center(8)
<Frame: x>
<Index>    a        b        <<U1>
<Index>
p             10      qrs
q             2       XYZ
r             8       123
s             3        wX
<<U1>      <<U8>    <<U8>
Frame.via_str.contains(item)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.contains('X')
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  True
r          False  False
s          False  True
<<U1>      <bool> <bool>
Frame.via_str.count(sub, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.count(sub, start=None, end=None)[source]

Returns a container with the number of non-overlapping occurrences of substring sub in the optional range start, end.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.count('X')
<Frame: x>
<Index>    a       b       <<U1>
<Index>
p          0       0
q          0       1
r          0       0
s          0       1
<<U1>      <int64> <int64>
Frame.via_str.decode(encoding, errors)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x').astype(bytes)
>>> f
<Frame: x>
<Index>    a      b       <<U1>
<Index>
p          b'10'  b'qrs '
q          b'2'   b'XYZ'
r          b'8'   b'123'
s          b'3'   b' wX '
<<U1>      <|S21> <|S4>
>>> f.via_str.decode()
<Frame: x>
<Index>    a     b     <<U1>
<Index>
p          10    qrs
q          2     XYZ
r          8     123
s          3      wX
<<U1>      <<U2> <<U4>
Frame.via_str.encode(encoding, errors)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.encode()
<Frame: x>
<Index>    a     b       <<U1>
<Index>
p          b'10' b'qrs '
q          b'2'  b'XYZ'
r          b'8'  b'123'
s          b'3'  b' wX '
<<U1>      <|S2> <|S4>
Frame.via_str.endswith(suffix, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.endswith(suffix, start=None, end=None)[source]

Returns a container with the number of non-overlapping occurrences of substring suffix (or an iterable of suffixes) in the optional range start, end.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.endswith(' ')
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  True
q          False  False
r          False  False
s          False  True
<<U1>      <bool> <bool>
Frame.via_str.find(sub, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.find(sub, start=None, end=None)[source]

For each element, return the lowest index in the string where substring sub is found.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.find('X')
<Frame: x>
<Index>    a       b       <<U1>
<Index>
p          -1      -1
q          -1      0
r          -1      -1
s          -1      2
<<U1>      <int64> <int64>
Frame.via_str.format(format)
Frame.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’s format 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).

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.format('{:-^10}')
<Frame: x>
<Index>    a          b          <<U1>
<Index>
p          ----10---- ---qrs ---
q          ----2----- ---XYZ----
r          ----8----- ---123----
s          ----3----- --- wX ---
<<U1>      <<U10>     <<U10>
Frame.via_str.index(sub, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.index(sub, start=None, end=None)[source]

Like find, but raises ValueError when the substring is not found.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.index('X')
ValueError('substring not found')
Frame.via_str.isalnum
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isalnum()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          True   False
q          True   True
r          True   True
s          True   False
<<U1>      <bool> <bool>
Frame.via_str.isalpha
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isalpha()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  True
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.isdecimal
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isdecimal()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          True   False
q          True   False
r          True   True
s          True   False
<<U1>      <bool> <bool>
Frame.via_str.isdigit
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isdigit()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          True   False
q          True   False
r          True   True
s          True   False
<<U1>      <bool> <bool>
Frame.via_str.islower
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.islower()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  True
q          False  False
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.isnumeric
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isnumeric()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          True   False
q          True   False
r          True   True
s          True   False
<<U1>      <bool> <bool>
Frame.via_str.isspace
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isspace()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  False
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.istitle
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.istitle()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  False
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.isupper
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.isupper()
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  True
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.ljust(width, fillchar)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.ljust(8)
<Frame: x>
<Index>    a        b        <<U1>
<Index>
p          10       qrs
q          2        XYZ
r          8        123
s          3         wX
<<U1>      <<U8>    <<U8>
Frame.via_str.len
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.len()[source]

Return the length of the string.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.len()
<Frame: x>
<Index>    a       b       <<U1>
<Index>
p          2       4
q          1       3
r          1       3
s          1       4
<<U1>      <int64> <int64>
Frame.via_str.lower
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.lower()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     qrs
q          2      xyz
r          8      123
s          3       wx
<<U1>      <<U21> <<U4>
Frame.via_str.lstrip(chars)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.lstrip()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     qrs
q          2      XYZ
r          8      123
s          3      wX
<<U1>      <<U21> <<U4>
Frame.via_str.partition(sep)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.partition(sep)[source]

Partition each element around sep.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.partition('X')
<Frame: x>
<Index>    a              b                <<U1>
<Index>
p          ('10', '', '') ('qrs ', '', '')
q          ('2', '', '')  ('', 'X', 'YZ')
r          ('8', '', '')  ('123', '', '')
s          ('3', '', '')  (' w', 'X', ' ')
<<U1>      <object>       <object>
Frame.via_str.replace(old, new, count)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.replace(old, new, count=None)[source]

Return a container with its elements replaced in a string of length width.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.replace('X', '*')
<Frame: x>
<Index>    a     b     <<U1>
<Index>
p          10    qrs
q          2     *YZ
r          8     123
s          3      w*
<<U1>      <<U2> <<U4>
Frame.via_str.rfind(sub, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.rfind(sub, start=None, end=None)[source]

For each element, return the highest index in the string where substring sub is found, such that sub is contained within start, end.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rfind('X')
<Frame: x>
<Index>    a       b       <<U1>
<Index>
p          -1      -1
q          -1      0
r          -1      -1
s          -1      2
<<U1>      <int64> <int64>
Frame.via_str.rindex(sub, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.rindex(sub, start=None, end=None)[source]

Like rfind, but raises ValueError when the substring sub is not found.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rindex('X')
ValueError('substring not found')
Frame.via_str.rjust(width, fillchar)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rjust(8)
<Frame: x>
<Index>    a        b        <<U1>
<Index>
p                10     qrs
q                 2      XYZ
r                 8      123
s                 3      wX
<<U1>      <<U8>    <<U8>
Frame.via_str.rpartition(sep)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rpartition('X')
<Frame: x>
<Index>    a              b                <<U1>
<Index>
p          ('', '', '10') ('', '', 'qrs ')
q          ('', '', '2')  ('', 'X', 'YZ')
r          ('', '', '8')  ('', '', '123')
s          ('', '', '3')  (' w', 'X', ' ')
<<U1>      <object>       <object>
Frame.via_str.rsplit(sep, maxsplit)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rsplit('X')
<Frame: x>
<Index>    a        b           <<U1>
<Index>
p          ('10',)  ('qrs ',)
q          ('2',)   ('', 'YZ')
r          ('8',)   ('123',)
s          ('3',)   (' w', ' ')
<<U1>      <object> <object>
Frame.via_str.rstrip(chars)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.rstrip()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     qrs
q          2      XYZ
r          8      123
s          3       wX
<<U1>      <<U21> <<U4>
Frame.via_str.split(sep, maxsplit)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.split('X')
<Frame: x>
<Index>    a        b           <<U1>
<Index>
p          ('10',)  ('qrs ',)
q          ('2',)   ('', 'YZ')
r          ('8',)   ('123',)
s          ('3',)   (' w', ' ')
<<U1>      <object> <object>
Frame.via_str.startswith(prefix, start, end)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.startswith(prefix, start=None, 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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.startswith('X')
<Frame: x>
<Index>    a      b      <<U1>
<Index>
p          False  False
q          False  True
r          False  False
s          False  False
<<U1>      <bool> <bool>
Frame.via_str.strip(chars)
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.strip()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     qrs
q          2      XYZ
r          8      123
s          3      wX
<<U1>      <<U21> <<U4>
Frame.via_str.swapcase
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.swapcase()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     QRS
q          2      xyz
r          8      123
s          3       Wx
<<U1>      <<U21> <<U4>
Frame.via_str.title
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.title()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     Qrs
q          2      Xyz
r          8      123
s          3       Wx
<<U1>      <<U21> <<U4>
Frame.via_str.upper
Frame.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.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.upper()
<Frame: x>
<Index>    a      b     <<U1>
<Index>
p          10     QRS
q          2      XYZ
r          8      123
s          3       WX
<<U1>      <<U21> <<U4>
Frame.via_str.zfill(width)
Frame.via_str

Interface for applying string methods to elements in this container.

InterfaceString.zfill(width)[source]

Return the string left-filled with zeros.

>>> f = sf.Frame.from_fields(((10, 2, 8, 3), ('qrs ', 'XYZ', '123', ' wX ')), columns=('a', 'b'), index=('p', 'q', 'r', 's'), name='x')
>>> f
<Frame: x>
<Index>    a       b     <<U1>
<Index>
p          10      qrs
q          2       XYZ
r          8       123
s          3        wX
<<U1>      <int64> <<U4>
>>> f.via_str.zfill(8)
<Frame: x>
<Index>    a        b        <<U1>
<Index>
p          00000010 0000qrs
q          00000002 00000XYZ
r          00000008 00000123
s          00000003 0000 wX
<<U1>      <<U8>    <<U8>

Frame: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Assignment | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic