@@ -570,9 +570,9 @@ def str_endswith(arr, pat, na=np.nan):
570
570
571
571
def str_replace (arr , pat , repl , n = - 1 , case = None , flags = 0 , regex = True ):
572
572
r"""
573
- Replace occurrences of pattern/regex in the Series/Index with
574
- some other string. Equivalent to :meth:`str.replace` or
575
- :func:`re.sub`, depending on the regex value.
573
+ Replace each occurrence of pattern/regex in the Series/Index.
574
+
575
+ Equivalent to :meth:`str.replace` or :func:`re.sub`, depending on the regex value.
576
576
577
577
Parameters
578
578
----------
@@ -1063,6 +1063,8 @@ def str_extract(arr, pat, flags=0, expand=True):
1063
1063
1064
1064
def str_extractall (arr , pat , flags = 0 ):
1065
1065
r"""
1066
+ Extract capture groups in the regex `pat` as columns in DataFrame.
1067
+
1066
1068
For each subject string in the Series, extract groups from all
1067
1069
matches of regular expression pat. When each subject string in the
1068
1070
Series has exactly one match, extractall(pat).xs(0, level='match')
@@ -1174,7 +1176,9 @@ def str_extractall(arr, pat, flags=0):
1174
1176
1175
1177
def str_get_dummies (arr , sep = "|" ):
1176
1178
"""
1177
- Split each string in the Series by sep and return a DataFrame
1179
+ Return DataFrame of dummy/indicator variables for Series.
1180
+
1181
+ Each string in Series is split by sep and returned as a DataFrame
1178
1182
of dummy/indicator variables.
1179
1183
1180
1184
Parameters
@@ -1743,8 +1747,7 @@ def str_strip(arr, to_strip=None, side="both"):
1743
1747
1744
1748
def str_wrap (arr , width , ** kwargs ):
1745
1749
r"""
1746
- Wrap long strings in the Series/Index to be formatted in
1747
- paragraphs with length less than a given width.
1750
+ Wrap strings in Series/Index at specified line width.
1748
1751
1749
1752
This method has the same keyword parameters and defaults as
1750
1753
:class:`textwrap.TextWrapper`.
@@ -1807,6 +1810,7 @@ def str_wrap(arr, width, **kwargs):
1807
1810
def str_translate (arr , table ):
1808
1811
"""
1809
1812
Map all characters in the string through the given mapping table.
1813
+
1810
1814
Equivalent to standard :meth:`str.translate`.
1811
1815
1812
1816
Parameters
@@ -1889,6 +1893,7 @@ def f(x):
1889
1893
def str_decode (arr , encoding , errors = "strict" ):
1890
1894
"""
1891
1895
Decode character string in the Series/Index using indicated encoding.
1896
+
1892
1897
Equivalent to :meth:`str.decode` in python2 and :meth:`bytes.decode` in
1893
1898
python3.
1894
1899
@@ -1913,6 +1918,7 @@ def str_decode(arr, encoding, errors="strict"):
1913
1918
def str_encode (arr , encoding , errors = "strict" ):
1914
1919
"""
1915
1920
Encode character string in the Series/Index using indicated encoding.
1921
+
1916
1922
Equivalent to :meth:`str.encode`.
1917
1923
1918
1924
Parameters
@@ -2068,9 +2074,11 @@ def do_copy(target):
2068
2074
2069
2075
class StringMethods (NoNewAttributesMixin ):
2070
2076
"""
2071
- Vectorized string functions for Series and Index. NAs stay NA unless
2072
- handled otherwise by a particular method. Patterned after Python's string
2073
- methods, with some inspiration from R's stringr package.
2077
+ Vectorized string functions for Series and Index.
2078
+
2079
+ NAs stay NA unless handled otherwise by a particular method.
2080
+ Patterned after Python's string methods, with some inspiration from
2081
+ R's stringr package.
2074
2082
2075
2083
Examples
2076
2084
--------
@@ -2853,8 +2861,9 @@ def pad(self, width, side="left", fillchar=" "):
2853
2861
_shared_docs [
2854
2862
"str_pad"
2855
2863
] = """
2856
- Filling %(side)s side of strings in the Series/Index with an
2857
- additional character. Equivalent to :meth:`str.%(method)s`.
2864
+ Pad %(side)s side of strings in the Series/Index.
2865
+
2866
+ Equivalent to :meth:`str.%(method)s`.
2858
2867
2859
2868
Parameters
2860
2869
----------
@@ -3117,9 +3126,11 @@ def extractall(self, pat, flags=0):
3117
3126
_shared_docs [
3118
3127
"find"
3119
3128
] = """
3120
- Return %(side)s indexes in each strings in the Series/Index
3121
- where the substring is fully contained between [start:end].
3122
- Return -1 on failure. Equivalent to standard :meth:`str.%(method)s`.
3129
+ Return %(side)s indexes in each strings in the Series/Index.
3130
+
3131
+ Each of returned indexes corresponds to the position where the
3132
+ substring is fully contained between [start:end]. Return -1 on
3133
+ failure. Equivalent to standard :meth:`str.%(method)s`.
3123
3134
3124
3135
Parameters
3125
3136
----------
@@ -3169,6 +3180,7 @@ def rfind(self, sub, start=0, end=None):
3169
3180
def normalize (self , form ):
3170
3181
"""
3171
3182
Return the Unicode normal form for the strings in the Series/Index.
3183
+
3172
3184
For more information on the forms, see the
3173
3185
:func:`unicodedata.normalize`.
3174
3186
@@ -3190,10 +3202,13 @@ def normalize(self, form):
3190
3202
_shared_docs [
3191
3203
"index"
3192
3204
] = """
3193
- Return %(side)s indexes in each strings where the substring is
3194
- fully contained between [start:end]. This is the same as
3195
- ``str.%(similar)s`` except instead of returning -1, it raises a ValueError
3196
- when the substring is not found. Equivalent to standard ``str.%(method)s``.
3205
+ Return %(side)s indexes in each string in Series/Index.
3206
+
3207
+ Each of the returned indexes corresponds to the position where the
3208
+ substring is fully contained between [start:end]. This is the same
3209
+ as ``str.%(similar)s`` except instead of returning -1, it raises a
3210
+ ValueError when the substring is not found. Equivalent to standard
3211
+ ``str.%(method)s``.
3197
3212
3198
3213
Parameters
3199
3214
----------
@@ -3244,8 +3259,9 @@ def rindex(self, sub, start=0, end=None):
3244
3259
_shared_docs [
3245
3260
"len"
3246
3261
] = """
3247
- Compute the length of each element in the Series/Index. The element may be
3248
- a sequence (such as a string, tuple or list) or a collection
3262
+ Compute the length of each element in the Series/Index.
3263
+
3264
+ The element may be a sequence (such as a string, tuple or list) or a collection
3249
3265
(such as a dictionary).
3250
3266
3251
3267
Returns
0 commit comments