Skip to content

Commit

Permalink
DOC: Delete more trailing blank lines in docstrings. (#23698)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglatornell authored and datapythonista committed Nov 15, 2018
1 parent a23f901 commit e98032d
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 27 deletions.
1 change: 0 additions & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,6 @@ class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):
>>> s.cat.set_categories(list('abcde'))
>>> s.cat.as_ordered()
>>> s.cat.as_unordered()
"""

def __init__(self, data):
Expand Down
1 change: 0 additions & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ def tz_localize(self, tz, ambiguous='raise', nonexistent='raise',
1 2018-10-28 02:36:00+02:00
2 2018-10-28 03:46:00+01:00
dtype: datetime64[ns, CET]
"""
if errors is not None:
warnings.warn("The errors argument is deprecated and will be "
Expand Down
17 changes: 3 additions & 14 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ def droplevel(self, level, axis=0):
axis : {0 or 'index', 1 or 'columns'}, default 0
Returns
-------
DataFrame.droplevel()
Expand Down Expand Up @@ -769,7 +768,6 @@ def droplevel(self, level, axis=0):
1 2 3 4
5 6 7 8
9 10 11 12
"""
labels = self._get_axis(axis)
new_labels = labels.droplevel(level)
Expand Down Expand Up @@ -1233,7 +1231,6 @@ def rename_axis(self, mapper=None, **kwargs):
2 3 30
c 1 4 40
2 5 50
"""
axes, kwargs = self._construct_axes_from_arguments((), kwargs)
copy = kwargs.pop('copy', True)
Expand Down Expand Up @@ -2075,7 +2072,6 @@ def _repr_latex_(self):
automatically chosen depending on the file extension):
>>> df1.to_excel('output1.xlsx', engine='xlsxwriter')
"""

def to_json(self, path_or_buf=None, orient=None, date_format=None,
Expand Down Expand Up @@ -2324,7 +2320,6 @@ def to_hdf(self, path_or_buf, key, **kwargs):
>>> import os
>>> os.remove('data.h5')
"""
from pandas.io import pytables
return pytables.to_hdf(path_or_buf, key, self, **kwargs)
Expand Down Expand Up @@ -3324,7 +3319,6 @@ def xs(self, key, axis=0, level=None, drop_level=True):
MultiIndex Slicers is a generic way to get/set values on any level or
levels. It is a superset of xs functionality, see
:ref:`MultiIndex Slicers <advanced.mi_slicers>`
"""
axis = self._get_axis_number(axis)
labels = self._get_axis(axis)
Expand Down Expand Up @@ -4886,7 +4880,6 @@ def as_matrix(self, columns=None):
If the caller is heterogeneous and contains booleans or objects,
the result will be of dtype=object. See Notes.
Notes
-----
Return is NOT a Numpy-matrix, rather, a Numpy-array.
Expand Down Expand Up @@ -8954,7 +8947,6 @@ def tz_localize(self, tz, axis=0, level=None, copy=True,
2018-10-28 02:36:00+02:00 1
2018-10-28 03:46:00+01:00 2
dtype: int64
"""
if nonexistent not in ('raise', 'NaT', 'shift'):
raise ValueError("The nonexistent argument must be one of 'raise',"
Expand Down Expand Up @@ -9651,7 +9643,7 @@ def compound(self, axis=None, skipna=None, level=None):
cls, 'kurt', name, name2, axis_descr,
"Return unbiased kurtosis over requested axis using Fisher's "
"definition of\nkurtosis (kurtosis of normal == 0.0). Normalized "
"by N-1\n",
"by N-1",
nanops.nankurt)
cls.kurtosis = cls.kurt
cls.prod = _make_min_count_stat_function(
Expand Down Expand Up @@ -9699,8 +9691,7 @@ def nanptp(values, axis=0, skipna=True):
``numpy.ndarray`` method ``ptp``.
.. deprecated:: 0.24.0
Use numpy.ptp instead
""",
Use numpy.ptp instead""",
nanptp)

@classmethod
Expand Down Expand Up @@ -9983,7 +9974,6 @@ def _doc_parms(cls):


_num_doc = """
%(desc)s
Parameters
Expand All @@ -10001,12 +9991,11 @@ def _doc_parms(cls):
Returns
-------
%(outname)s : %(name1)s or %(name2)s (if level specified)
%(outname)s : %(name1)s or %(name2)s (if level specified)\
%(examples)s"""

_num_ddof_doc = """
%(desc)s
Parameters
Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,6 @@ class _IXIndexer(_NDFrameIndexer):
usually better to be explicit and use ``.iloc`` or ``.loc``.
See more at :ref:`Advanced Indexing <advanced>`.
"""

def __init__(self, name, obj):
Expand Down
11 changes: 3 additions & 8 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=True):
A copy of the object with all matching occurrences of `pat` replaced by
`repl`.
Raises
------
ValueError
Expand Down Expand Up @@ -549,7 +548,6 @@ def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=True):
1 bar
2 NaN
dtype: object
"""

# Check whether repl is valid (GH 13438, GH 15055)
Expand Down Expand Up @@ -667,10 +665,9 @@ def str_match(arr, pat, case=True, flags=0, na=np.nan):
See Also
--------
contains : Analogous, but less strict, relying on re.search instead of
re.match.
extract : Extract matched groups.
contains : analogous, but less strict, relying on re.search instead of
re.match
extract : extract matched groups
"""
if not case:
flags |= re.IGNORECASE
Expand Down Expand Up @@ -1177,7 +1174,6 @@ def str_findall(arr, pat, flags=0):
1 []
2 [b, b]
dtype: object
"""
regex = re.compile(pat, flags=flags)
return _na_map(regex.findall, arr)
Expand Down Expand Up @@ -2433,7 +2429,6 @@ def rsplit(self, pat=None, n=-1, expand=False):
Examples
--------
>>> s = pd.Series(['Linda van der Berg', 'George Pitt-Rivers'])
>>> s
0 Linda van der Berg
Expand Down
1 change: 0 additions & 1 deletion pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ class Window(_Window):
2013-01-01 09:00:05 NaN
2013-01-01 09:00:06 4.0
Contrasting to an integer rolling window, this will roll a variable
length window corresponding to the time period.
The default for min_periods is 1.
Expand Down
1 change: 0 additions & 1 deletion pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,6 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
See Also
--------
matplotlib.axes.Axes.hist : Plot a histogram using matplotlib.
"""
import matplotlib.pyplot as plt

Expand Down

0 comments on commit e98032d

Please sign in to comment.