Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Delete more trailing blank lines in docstrings. #23698

Merged
merged 2 commits into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -746,7 +746,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 @@ -728,7 +728,6 @@ def droplevel(self, level, axis=0):

axis : {0 or 'index', 1 or 'columns'}, default 0


Returns
-------
DataFrame.droplevel()
Expand Down Expand Up @@ -767,7 +766,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 @@ -1231,7 +1229,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 @@ -2072,7 +2069,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 @@ -2321,7 +2317,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 @@ -3321,7 +3316,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 @@ -4883,7 +4877,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 @@ -8951,7 +8944,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 @@ -9648,7 +9640,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 @@ -9696,8 +9688,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 @@ -9961,7 +9952,6 @@ def _doc_parms(cls):


_num_doc = """

%(desc)s

Parameters
Expand All @@ -9979,12 +9969,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
5 changes: 0 additions & 5 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 @@ -670,7 +668,6 @@ def str_match(arr, pat, case=True, flags=0, na=np.nan):
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 @@ -2460,7 +2460,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