Skip to content

Commit 2cea659

Browse files
DOC: Fixes to docstring to add validation to CI (#23560)
1 parent 274ef6f commit 2cea659

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

pandas/core/frame.py

+21-17
Original file line numberDiff line numberDiff line change
@@ -864,12 +864,17 @@ def iterrows(self):
864864
data types, the iterator returns a copy and not a view, and writing
865865
to it will have no effect.
866866
867-
Returns
868-
-------
867+
Yields
868+
------
869+
index : label or tuple of label
870+
The index of the row. A tuple for a `MultiIndex`.
871+
data : Series
872+
The data of the row as a Series.
873+
869874
it : generator
870875
A generator that iterates over the rows of the frame.
871876
872-
See also
877+
See Also
873878
--------
874879
itertuples : Iterate over DataFrame rows as namedtuples of the values.
875880
iteritems : Iterate over (column name, Series) pairs.
@@ -3951,6 +3956,10 @@ def set_index(self, keys, drop=True, append=False, inplace=False,
39513956
necessary. Setting to False will improve the performance of this
39523957
method
39533958
3959+
Returns
3960+
-------
3961+
DataFrame
3962+
39543963
Examples
39553964
--------
39563965
>>> df = pd.DataFrame({'month': [1, 4, 7, 10],
@@ -3991,10 +4000,6 @@ def set_index(self, keys, drop=True, append=False, inplace=False,
39914000
2 2014 4 40
39924001
3 2013 7 84
39934002
4 2014 10 31
3994-
3995-
Returns
3996-
-------
3997-
dataframe : DataFrame
39984003
"""
39994004
inplace = validate_bool_kwarg(inplace, 'inplace')
40004005
if not isinstance(keys, list):
@@ -6694,6 +6699,15 @@ def round(self, decimals=0, *args, **kwargs):
66946699
of `decimals` which are not columns of the input will be
66956700
ignored.
66966701
6702+
Returns
6703+
-------
6704+
DataFrame
6705+
6706+
See Also
6707+
--------
6708+
numpy.around
6709+
Series.round
6710+
66976711
Examples
66986712
--------
66996713
>>> df = pd.DataFrame(np.random.random([3, 3]),
@@ -6719,15 +6733,6 @@ def round(self, decimals=0, *args, **kwargs):
67196733
first 0.0 1 0.17
67206734
second 0.0 1 0.58
67216735
third 0.9 0 0.49
6722-
6723-
Returns
6724-
-------
6725-
DataFrame object
6726-
6727-
See Also
6728-
--------
6729-
numpy.around
6730-
Series.round
67316736
"""
67326737
from pandas.core.reshape.concat import concat
67336738

@@ -6793,7 +6798,6 @@ def corr(self, method='pearson', min_periods=1):
67936798
67946799
Examples
67956800
--------
6796-
>>> import numpy as np
67976801
>>> histogram_intersection = lambda a, b: np.minimum(a, b
67986802
... ).sum().round(decimals=1)
67996803
>>> df = pd.DataFrame([(.2, .3), (.0, .6), (.6, .0), (.2, .1)],

pandas/core/generic.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9691,8 +9691,7 @@ def nanptp(values, axis=0, skipna=True):
96919691

96929692
cls.ptp = _make_stat_function(
96939693
cls, 'ptp', name, name2, axis_descr,
9694-
"""
9695-
Returns the difference between the maximum value and the
9694+
"""Returns the difference between the maximum value and the
96969695
minimum value in the object. This is the equivalent of the
96979696
``numpy.ndarray`` method ``ptp``.
96989697

pandas/core/panel.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ def panel_index(time, panels, names=None):
106106

107107
class Panel(NDFrame):
108108
"""
109-
Represents wide format panel data, stored as 3-dimensional array
110-
111-
.. deprecated:: 0.20.0
112-
The recommended way to represent 3-D data are with a MultiIndex on a
113-
DataFrame via the :attr:`~Panel.to_frame()` method or with the
114-
`xarray package <http://xarray.pydata.org/en/stable/>`__.
115-
Pandas provides a :attr:`~Panel.to_xarray()` method to automate this
116-
conversion.
109+
Represents wide format panel data, stored as 3-dimensional array.
110+
111+
.. deprecated:: 0.20.0
112+
The recommended way to represent 3-D data are with a MultiIndex on a
113+
DataFrame via the :attr:`~Panel.to_frame()` method or with the
114+
`xarray package <http://xarray.pydata.org/en/stable/>`__.
115+
Pandas provides a :attr:`~Panel.to_xarray()` method to automate this
116+
conversion.
117117
118118
Parameters
119119
----------

pandas/core/series.py

-1
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,6 @@ def corr(self, other, method='pearson', min_periods=None):
19131913
19141914
Examples
19151915
--------
1916-
>>> import numpy as np
19171916
>>> histogram_intersection = lambda a, b: np.minimum(a, b
19181917
... ).sum().round(decimals=1)
19191918
>>> s1 = pd.Series([.2, .0, .6, .2])

0 commit comments

Comments
 (0)