Skip to content

Fix: Use only one blank line to separate sections or paragraphs #23871

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

Merged
merged 2 commits into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def unique(values):
--------
pandas.Index.unique
pandas.Series.unique

"""

values = _ensure_arraylike(values)
Expand Down
1 change: 0 additions & 1 deletion pandas/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ class option_context(object):

>>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
... ...

"""

def __init__(self, *args):
Expand Down
1 change: 0 additions & 1 deletion pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,6 @@ def pandas_dtype(dtype):
Raises
------
TypeError if not a dtype

"""
# short-circuit
if isinstance(dtype, np.ndarray):
Expand Down
6 changes: 0 additions & 6 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,6 @@ def iterrows(self):
--------
itertuples : Iterate over DataFrame rows as namedtuples of the values.
iteritems : Iterate over (column name, Series) pairs.

"""
columns = self.columns
klass = self._constructor_sliced
Expand Down Expand Up @@ -1722,7 +1721,6 @@ def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
Returns
-------
y : DataFrame

"""

warnings.warn("from_csv is deprecated. Please use read_csv(...) "
Expand Down Expand Up @@ -1963,7 +1961,6 @@ def to_feather(self, fname):
----------
fname : str
string file path

"""
from pandas.io.feather_format import to_feather
to_feather(self, fname)
Expand Down Expand Up @@ -3578,7 +3575,6 @@ def lookup(self, row_labels, col_labels):
--------
values : ndarray
The found values

"""
n = len(row_labels)
if n != len(col_labels):
Expand Down Expand Up @@ -4881,7 +4877,6 @@ def swaplevel(self, i=-2, j=-1, axis=0):

The indexes ``i`` and ``j`` are now optional, and default to
the two innermost levels of the index.

"""
result = self.copy()

Expand Down Expand Up @@ -7115,7 +7110,6 @@ def count(self, axis=0, level=None, numeric_only=False):
John 2
Lewis 1
Myla 1

"""
axis = self._get_axis_number(axis)
if level is not None:
Expand Down
1 change: 0 additions & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,6 @@ class DataFrameGroupBy(NDFrameGroupBy):
pandas.DataFrame.groupby.apply
pandas.DataFrame.groupby.transform
pandas.DataFrame.aggregate

""")

@Appender(_agg_doc)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class providing the base-class of operations.
from pandas.core.sorting import get_group_index_sorter

_doc_template = """

See Also
--------
pandas.Series.%(name)s
Expand Down Expand Up @@ -1049,7 +1048,8 @@ def any(self, skipna=True):
@Substitution(name='groupby')
@Appender(_doc_template)
def all(self, skipna=True):
"""Returns True if all values in the group are truthful, else False
"""
Returns True if all values in the group are truthful, else False

Parameters
----------
Expand Down
7 changes: 0 additions & 7 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,6 @@ def to_frame(self, index=True, name=None):
or the original Index is returned.

.. versionadded:: 0.19.0

"""

@Appender(_index_shared_docs['astype'])
Expand Down Expand Up @@ -2539,7 +2538,6 @@ def asof_locs(self, where, mask):
"""
where : array of timestamps
mask : array of booleans where data is not NA

"""
locs = self.values[mask].searchsorted(where.values, side='right')

Expand Down Expand Up @@ -2785,7 +2783,6 @@ def union(self, other):
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.union(idx2)
Int64Index([1, 2, 3, 4, 5, 6], dtype='int64')

"""
self._assert_can_do_setop(other)
other = ensure_index(other)
Expand Down Expand Up @@ -2884,7 +2881,6 @@ def intersection(self, other):
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Int64Index([3, 4], dtype='int64')

"""
self._assert_can_do_setop(other)
other = ensure_index(other)
Expand Down Expand Up @@ -2956,7 +2952,6 @@ def difference(self, other, sort=True):
Int64Index([1, 2], dtype='int64')
>>> idx1.difference(idx2, sort=False)
Int64Index([2, 1], dtype='int64')

"""
self._assert_can_do_setop(other)

Expand Down Expand Up @@ -3342,7 +3337,6 @@ def droplevel(self, level=0):

Notice that the return value is an array of locations in ``index``
and ``x`` is marked by -1, as it is not in ``index``.

"""

@Appender(_index_shared_docs['get_indexer'] % _index_doc_kwargs)
Expand Down Expand Up @@ -4374,7 +4368,6 @@ def get_slice_bound(self, label, side, kind):
label : object
side : {'left', 'right'}
kind : {'ix', 'loc', 'getitem'}

"""
assert kind in ['ix', 'loc', 'getitem', None]

Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
typ='method', overwrite=True)
class CategoricalIndex(Index, accessor.PandasDelegate):
"""

Immutable Index implementing an ordered, sliceable set. CategoricalIndex
represents a sparsely populated Index with an underlying Categorical.

Expand Down
2 changes: 0 additions & 2 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class DatetimeIndex(DatetimeArray, DatelikeOps, TimelikeOps,
TimedeltaIndex : Index of timedelta64 data.
PeriodIndex : Index of Period data.
pandas.to_datetime : Convert argument to datetime.

"""
_typ = 'datetimeindex'
_join_precedence = 10
Expand Down Expand Up @@ -546,7 +545,6 @@ def to_series(self, keep_tz=None, index=None, name=None):
def snap(self, freq='S'):
"""
Snap time stamps to nearest occurring frequency

"""
# Superdumb, punting on any optimizing
freq = to_offset(freq)
Expand Down
4 changes: 0 additions & 4 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ def set_levels(self, levels, level=None, inplace=False,
-------
new index (of same type and class...etc)


Examples
--------
>>> idx = pd.MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
Expand Down Expand Up @@ -1519,7 +1518,6 @@ def remove_unused_levels(self):
MultiIndex(levels=[[0, 1], ['a', 'b']],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]])


>>> i[2:]
MultiIndex(levels=[[0, 1], ['a', 'b']],
labels=[[1, 1], [0, 1]])
Expand All @@ -1530,7 +1528,6 @@ def remove_unused_levels(self):
>>> i[2:].remove_unused_levels()
MultiIndex(levels=[[1], ['a', 'b']],
labels=[[0, 0], [0, 1]])

"""

new_levels = []
Expand Down Expand Up @@ -1912,7 +1909,6 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True):
Resulting index
indexer : np.ndarray
Indices of output values in original index

"""
from pandas.core.sorting import indexer_from_factorized

Expand Down
3 changes: 0 additions & 3 deletions pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ def major_xs(self, key):
MultiIndex Slicers is a generic way to get/set values on any level or
levels and is a superset of major_xs functionality, see
:ref:`MultiIndex Slicers <advanced.mi_slicers>`

"""
return self.xs(key, axis=self._AXIS_LEN - 2)

Expand All @@ -831,7 +830,6 @@ def minor_xs(self, key):
MultiIndex Slicers is a generic way to get/set values on any level or
levels and is a superset of minor_xs functionality, see
:ref:`MultiIndex Slicers <advanced.mi_slicers>`

"""
return self.xs(key, axis=self._AXIS_LEN - 1)

Expand All @@ -856,7 +854,6 @@ def xs(self, key, axis=1):
MultiIndex Slicers is a generic way to get/set values on any level or
levels and is a superset of xs functionality, see
:ref:`MultiIndex Slicers <advanced.mi_slicers>`

"""
axis = self._get_axis_number(axis)
if axis == 0:
Expand Down
3 changes: 0 additions & 3 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def __iter__(self):
See Also
--------
GroupBy.__iter__

"""
self._set_binner()
return super(Resampler, self).__iter__()
Expand Down Expand Up @@ -204,7 +203,6 @@ def pipe(self, func, *args, **kwargs):
return super(Resampler, self).pipe(func, *args, **kwargs)

_agg_doc = dedent("""

Examples
--------
>>> s = pd.Series([1,2,3,4,5],
Expand Down Expand Up @@ -244,7 +242,6 @@ def pipe(self, func, *args, **kwargs):
pandas.DataFrame.groupby.aggregate
pandas.DataFrame.resample.transform
pandas.DataFrame.aggregate

""")

@Appender(_agg_doc)
Expand Down
3 changes: 0 additions & 3 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ def merge_ordered(left, right, on=None,
--------
merge
merge_asof

"""
def _merger(x, y):
# perform the ordered merge operation
Expand Down Expand Up @@ -312,7 +311,6 @@ def merge_asof(left, right, on=None,

.. versionadded:: 0.20.0


Returns
-------
merged : DataFrame
Expand Down Expand Up @@ -451,7 +449,6 @@ def merge_asof(left, right, on=None,
--------
merge
merge_ordered

"""
op = _AsOfMerge(left, right,
on=on, left_on=left_on, right_on=right_on,
Expand Down
1 change: 0 additions & 1 deletion pandas/core/reshape/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ def crosstab(index, columns, values=None, rownames=None, colnames=None,

.. versionadded:: 0.18.1


Notes
-----
Any Series passed will have their name attributes used unless row or column
Expand Down
2 changes: 0 additions & 2 deletions pandas/core/util/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def hash_pandas_object(obj, index=True, encoding='utf8', hash_key=None,
Returns
-------
Series of uint64, same length as the object

"""
from pandas import Series
if hash_key is None:
Expand Down Expand Up @@ -248,7 +247,6 @@ def hash_array(vals, encoding='utf8', hash_key=None, categorize=True):
Returns
-------
1d uint64 numpy array of hash values, same length as the vals

"""

if not hasattr(vals, 'dtype'):
Expand Down
5 changes: 0 additions & 5 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,6 @@ def _validate_freq(self):
8 -0.289082 2.454418 1.416871
9 0.212668 0.403198 -0.093924


>>> df.rolling(3).agg({'A':'sum', 'B':'min'})
A B
0 NaN NaN
Expand All @@ -1631,7 +1630,6 @@ def _validate_freq(self):
--------
pandas.Series.rolling
pandas.DataFrame.rolling

""")

@Appender(_agg_doc)
Expand Down Expand Up @@ -1908,7 +1906,6 @@ def _get_window(self, other=None):
pandas.DataFrame.expanding.aggregate
pandas.DataFrame.rolling.aggregate
pandas.DataFrame.aggregate

""")

@Appender(_agg_doc)
Expand Down Expand Up @@ -2209,7 +2206,6 @@ def _constructor(self):
See Also
--------
pandas.DataFrame.rolling.aggregate

""")

@Appender(_agg_doc)
Expand All @@ -2233,7 +2229,6 @@ def _apply(self, func, **kwargs):
Returns
-------
y : same type as input argument

"""
blocks, obj, index = self._create_blocks()
results = []
Expand Down
1 change: 0 additions & 1 deletion pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class UnsortedIndexError(KeyError):
and the index has not been lexsorted. Subclass of `KeyError`.

.. versionadded:: 0.20.0

"""


Expand Down
3 changes: 0 additions & 3 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ def applymap(self, func, subset=None, **kwargs):
See Also
--------
Styler.where

"""
self._todo.append((lambda instance: getattr(instance, '_applymap'),
(func, subset), kwargs))
Expand Down Expand Up @@ -672,7 +671,6 @@ def where(self, cond, value, other=None, subset=None, **kwargs):
See Also
--------
Styler.applymap

"""

if other is None:
Expand Down Expand Up @@ -1104,7 +1102,6 @@ def bar(self, subset=None, axis=0, color='#d65f5f', width=100,

.. versionadded:: 0.24.0


Returns
-------
self : Styler
Expand Down
1 change: 0 additions & 1 deletion pandas/io/json/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def json_normalize(data, record_path=None, meta=None,

.. versionadded:: 0.20.0


Returns
-------
frame : DataFrame
Expand Down
1 change: 0 additions & 1 deletion pandas/io/packers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def read_msgpack(path_or_buf, encoding='utf-8', iterator=False, **kwargs):
Returns
-------
obj : same type as object stored in file

"""
path_or_buf, _, _, should_close = get_filepath_or_buffer(path_or_buf)
if iterator:
Expand Down
Loading