Skip to content

Commit 06777a7

Browse files
committed
DOC: remove some doc-build warnings
1 parent 47f0222 commit 06777a7

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

doc/source/10min.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ financial applications. See the :ref:`Time Series section <timeseries>`
604604
605605
rng = pd.date_range('1/1/2012', periods=100, freq='S')
606606
ts = pd.Series(np.random.randint(0, 500, len(rng)), index=rng)
607-
ts.resample('5Min', how='sum')
607+
ts.resample('5Min').sum()
608608
609609
Time zone representation
610610

doc/source/text.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ Extract first match in each subject (extract)
184184

185185
The ``extract`` method accepts a `regular expression
186186
<https://docs.python.org/2/library/re.html>`__ with at least one
187-
capture group.
187+
capture group.
188188

189189
Extracting a regular expression with more than one group returns a
190190
DataFrame with one column per group.
191191

192192
.. ipython:: python
193193
194-
pd.Series(['a1', 'b2', 'c3']).str.extract('([ab])(\d)')
194+
pd.Series(['a1', 'b2', 'c3']).str.extract('([ab])(\d)', expand=False)
195195
196196
Elements that do not match return a row filled with ``NaN``. Thus, a
197197
Series of messy strings can be "converted" into a like-indexed Series
@@ -204,13 +204,13 @@ Named groups like
204204

205205
.. ipython:: python
206206
207-
pd.Series(['a1', 'b2', 'c3']).str.extract('(?P<letter>[ab])(?P<digit>\d)')
207+
pd.Series(['a1', 'b2', 'c3']).str.extract('(?P<letter>[ab])(?P<digit>\d)', expand=False)
208208
209209
and optional groups like
210210

211211
.. ipython:: python
212212
213-
pd.Series(['a1', 'b2', '3']).str.extract('([ab])?(\d)')
213+
pd.Series(['a1', 'b2', '3']).str.extract('([ab])?(\d)', expand=False)
214214
215215
can also be used. Note that any capture group names in the regular
216216
expression will be used for column names; otherwise capture group
@@ -281,7 +281,7 @@ Unlike ``extract`` (which returns only the first match),
281281
282282
s = pd.Series(["a1a2", "b1", "c1"], ["A", "B", "C"])
283283
s
284-
s.str.extract("[ab](?P<digit>\d)")
284+
s.str.extract("[ab](?P<digit>\d)", expand=False)
285285
286286
.. versionadded:: 0.18.0
287287

@@ -307,7 +307,7 @@ then ``extractall(pat).xs(0, level='match')`` gives the same result as
307307

308308
.. ipython:: python
309309
310-
extract_result = s.str.extract(two_groups)
310+
extract_result = s.str.extract(two_groups, expand=False)
311311
extract_result
312312
extractall_result = s.str.extractall(two_groups)
313313
extractall_result

doc/source/whatsnew/v0.13.0.txt

+4
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ Enhancements
536536
matches more conveniently.
537537

538538
.. ipython:: python
539+
:okwarning:
539540

540541
Series(['a1', 'b2', 'c3']).str.extract('[ab](\d)')
541542

@@ -544,6 +545,7 @@ Enhancements
544545

545546

546547
.. ipython:: python
548+
:okwarning:
547549

548550
Series(['a1', 'b2', 'c3']).str.extract('([ab])(\d)')
549551

@@ -555,13 +557,15 @@ Enhancements
555557
Named groups like
556558

557559
.. ipython:: python
560+
:okwarning:
558561

559562
Series(['a1', 'b2', 'c3']).str.extract(
560563
'(?P<letter>[ab])(?P<digit>\d)')
561564

562565
and optional groups can also be used.
563566

564567
.. ipython:: python
568+
:okwarning:
565569

566570
Series(['a1', 'b2', '3']).str.extract(
567571
'(?P<letter>[ab])?(?P<digit>\d)')

doc/source/whatsnew/v0.18.0.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Currently the default is ``expand=None`` which gives a ``FutureWarning`` and use
157157

158158
.. ipython:: python
159159

160-
pd.Series(['a1', 'b2', 'c3']).str.extract('[ab](\d)')
160+
pd.Series(['a1', 'b2', 'c3']).str.extract('[ab](\d)', expand=False)
161161

162162
Extracting a regular expression with one group returns a ``DataFrame``
163163
with one column if ``expand=True``.
@@ -218,7 +218,7 @@ match),
218218

219219
s = pd.Series(["a1a2", "b1", "c1"], ["A", "B", "C"])
220220
s
221-
s.str.extract("(?P<letter>[ab])(?P<digit>\d)")
221+
s.str.extract("(?P<letter>[ab])(?P<digit>\d)", expand=False)
222222

223223
the ``extractall`` method returns all matches.
224224

@@ -566,6 +566,7 @@ yields a ``Resampler``.
566566

567567
.. ipython:: python
568568

569+
569570
r = df.resample('2s')
570571
r
571572

0 commit comments

Comments
 (0)