Skip to content

Commit 3be3254

Browse files
DOC: Fixup docstring (#21663)
1 parent a740b89 commit 3be3254

File tree

10 files changed

+22
-27
lines changed

10 files changed

+22
-27
lines changed

doc/source/merging.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ You can also pass a list of dicts or Series:
494494
495495
dicts = [{'A': 1, 'B': 2, 'C': 3, 'X': 4},
496496
{'A': 5, 'B': 6, 'C': 7, 'Y': 8}]
497-
result = df1.append(dicts, ignore_index=True)
497+
result = df1.append(dicts, ignore_index=True, sort=False)
498498
499499
.. ipython:: python
500500
:suppress:

doc/source/text.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ For concatenation with a ``Series`` or ``DataFrame``, it is possible to align th
270270
the ``join``-keyword.
271271

272272
.. ipython:: python
273+
:okwarning:
273274
274-
u = pd.Series(['b', 'd', 'a', 'c'], index=[1, 3, 0, 2])
275-
s
276-
u
277-
s.str.cat(u)
278-
s.str.cat(u, join='left')
275+
u = pd.Series(['b', 'd', 'a', 'c'], index=[1, 3, 0, 2])
276+
s
277+
u
278+
s.str.cat(u)
279+
s.str.cat(u, join='left')
279280
280281
.. warning::
281282

@@ -296,7 +297,7 @@ In particular, alignment also means that the different lengths do not need to co
296297
The same alignment can be used when ``others`` is a ``DataFrame``:
297298

298299
.. ipython:: python
299-
300+
300301
f = d.loc[[3, 2, 1, 0], :]
301302
s
302303
f
@@ -311,7 +312,7 @@ All one-dimensional list-likes can be arbitrarily combined in a list-like contai
311312
312313
s
313314
u
314-
s.str.cat([u, pd.Index(u.values), ['A', 'B', 'C', 'D'], map(str, u.index)], na_rep='-')
315+
s.str.cat([u, u.values, ['A', 'B', 'C', 'D'], map(str, u.index)], na_rep='-')
315316
316317
All elements must match in length to the calling ``Series`` (or ``Index``), except those having an index if ``join`` is not None:
317318

doc/source/whatsnew/v0.10.0.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,12 @@ The old behavior of printing out summary information can be achieved via the
281281

282282
The width of each line can be changed via 'line_width' (80 by default):
283283

284-
.. ipython:: python
284+
.. code-block:: python
285285

286286
pd.set_option('line_width', 40)
287287

288288
wide_frame
289289

290-
.. ipython:: python
291-
:suppress:
292-
293-
pd.reset_option('line_width')
294-
295290

296291
Updated PyTables Support
297292
~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/whatsnew/v0.13.1.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ API changes
119119
equal. NaNs in identical locations are treated as
120120
equal. (:issue:`5283`) See also :ref:`the docs<basics.equals>` for a motivating example.
121121

122-
.. ipython:: python
123-
:okwarning:
122+
.. code-block:: python
124123

125124
df = DataFrame({'col':['foo', 0, np.nan]})
126125
df2 = DataFrame({'col':[np.nan, 0, 'foo']}, index=[2,1,0])

doc/source/whatsnew/v0.14.1.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ Enhancements
9292
``offsets.apply``, ``rollforward`` and ``rollback`` resets the time (hour,
9393
minute, etc) or not (default ``False``, preserves time) (:issue:`7156`):
9494

95-
.. ipython:: python
95+
.. code-block:: python
9696

97-
import pandas.tseries.offsets as offsets
97+
import pandas.tseries.offsets as offsets
9898

99-
day = offsets.Day()
100-
day.apply(Timestamp('2014-01-01 09:00'))
99+
day = offsets.Day()
100+
day.apply(Timestamp('2014-01-01 09:00'))
101101

102-
day = offsets.Day(normalize=True)
103-
day.apply(Timestamp('2014-01-01 09:00'))
102+
day = offsets.Day(normalize=True)
103+
day.apply(Timestamp('2014-01-01 09:00'))
104104

105105
- ``PeriodIndex`` is represented as the same format as ``DatetimeIndex`` (:issue:`7601`)
106106
- ``StringMethods`` now work on empty Series (:issue:`7242`)

doc/source/whatsnew/v0.15.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ Other:
10081008
business_dates = date_range(start='4/1/2014', end='6/30/2014', freq='B')
10091009
df = DataFrame(1, index=business_dates, columns=['a', 'b'])
10101010
# get the first, 4th, and last date index for each month
1011-
df.groupby((df.index.year, df.index.month)).nth([0, 3, -1])
1011+
df.groupby([df.index.year, df.index.month]).nth([0, 3, -1])
10121012

10131013
- ``Period`` and ``PeriodIndex`` supports addition/subtraction with ``timedelta``-likes (:issue:`7966`)
10141014

doc/source/whatsnew/v0.17.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ We can render the HTML to get the following table.
5858
:file: whatsnew_0171_html_table.html
5959

6060
:class:`~pandas.core.style.Styler` interacts nicely with the Jupyter Notebook.
61-
See the :doc:`documentation <style>` for more.
61+
See the :ref:`documentation </style.ipynb>` for more.
6262

6363
.. _whatsnew_0171.enhancements:
6464

doc/source/whatsnew/v0.24.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Timezones
308308
^^^^^^^^^
309309

310310
- Bug in :meth:`DatetimeIndex.shift` where an ``AssertionError`` would raise when shifting across DST (:issue:`8616`)
311-
- Bug in :class:`Timestamp` constructor where passing an invalid timezone offset designator (``Z``) would not raise a ``ValueError``(:issue:`8910`)
311+
- Bug in :class:`Timestamp` constructor where passing an invalid timezone offset designator (``Z``) would not raise a ``ValueError`` (:issue:`8910`)
312312
- Bug in :meth:`Timestamp.replace` where replacing at a DST boundary would retain an incorrect offset (:issue:`7825`)
313313
- Bug in :meth:`Series.replace` with ``datetime64[ns, tz]`` data when replacing ``NaT`` (:issue:`11792`)
314314
- Bug in :class:`Timestamp` when passing different string date formats with a timezone offset would produce different timezone offsets (:issue:`12064`)

doc/source/whatsnew/v0.8.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ types. For example, ``'kde'`` is a new option:
178178
s = Series(np.concatenate((np.random.randn(1000),
179179
np.random.randn(1000) * 0.5 + 3)))
180180
plt.figure()
181-
s.hist(normed=True, alpha=0.2)
181+
s.hist(density=True, alpha=0.2)
182182
s.plot(kind='kde')
183183

184184
See :ref:`the plotting page <visualization.other>` for much more.

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ def mode(self, dropna=True):
14411441
Always returns Series even if only one value is returned.
14421442
14431443
Parameters
1444-
-------
1444+
----------
14451445
dropna : boolean, default True
14461446
Don't consider counts of NaN/NaT.
14471447

0 commit comments

Comments
 (0)