diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 333f4e5ea21b4..d226d8c2e7ee2 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -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): diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 04d6b5f161956..bacbece718e9a 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -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 " diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9f56433c6868e..a1d60c493dda0 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -730,7 +730,6 @@ def droplevel(self, level, axis=0): axis : {0 or 'index', 1 or 'columns'}, default 0 - Returns ------- DataFrame.droplevel() @@ -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) @@ -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) @@ -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, @@ -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) @@ -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 ` - """ axis = self._get_axis_number(axis) labels = self._get_axis(axis) @@ -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. @@ -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'," @@ -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( @@ -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 @@ -9983,7 +9974,6 @@ def _doc_parms(cls): _num_doc = """ - %(desc)s Parameters @@ -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 diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index d376c95a7e1b3..8ed181381f668 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1405,7 +1405,6 @@ class _IXIndexer(_NDFrameIndexer): usually better to be explicit and use ``.iloc`` or ``.loc``. See more at :ref:`Advanced Indexing `. - """ def __init__(self, name, obj): diff --git a/pandas/core/strings.py b/pandas/core/strings.py index 99aab607b2bf0..412763e6d81cb 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/pandas/core/window.py b/pandas/core/window.py index edd7191bcc458..f7a60527602a1 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -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. diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 83ab3b6098956..9e07be5e1769e 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -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