Skip to content

Commit dc0674d

Browse files
Fix: Removing in docstrings double blank lines and blank lines at the end (#23871)
1 parent 94ce05d commit dc0674d

File tree

26 files changed

+2
-61
lines changed

26 files changed

+2
-61
lines changed

pandas/core/algorithms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ def unique(values):
343343
--------
344344
pandas.Index.unique
345345
pandas.Series.unique
346-
347346
"""
348347

349348
values = _ensure_arraylike(values)

pandas/core/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ class option_context(object):
385385
386386
>>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
387387
... ...
388-
389388
"""
390389

391390
def __init__(self, *args):

pandas/core/dtypes/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,6 @@ def pandas_dtype(dtype):
20672067
Raises
20682068
------
20692069
TypeError if not a dtype
2070-
20712070
"""
20722071
# short-circuit
20732072
if isinstance(dtype, np.ndarray):

pandas/core/frame.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,6 @@ def iterrows(self):
877877
--------
878878
itertuples : Iterate over DataFrame rows as namedtuples of the values.
879879
iteritems : Iterate over (column name, Series) pairs.
880-
881880
"""
882881
columns = self.columns
883882
klass = self._constructor_sliced
@@ -1722,7 +1721,6 @@ def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
17221721
Returns
17231722
-------
17241723
y : DataFrame
1725-
17261724
"""
17271725

17281726
warnings.warn("from_csv is deprecated. Please use read_csv(...) "
@@ -1963,7 +1961,6 @@ def to_feather(self, fname):
19631961
----------
19641962
fname : str
19651963
string file path
1966-
19671964
"""
19681965
from pandas.io.feather_format import to_feather
19691966
to_feather(self, fname)
@@ -3578,7 +3575,6 @@ def lookup(self, row_labels, col_labels):
35783575
--------
35793576
values : ndarray
35803577
The found values
3581-
35823578
"""
35833579
n = len(row_labels)
35843580
if n != len(col_labels):
@@ -4881,7 +4877,6 @@ def swaplevel(self, i=-2, j=-1, axis=0):
48814877
48824878
The indexes ``i`` and ``j`` are now optional, and default to
48834879
the two innermost levels of the index.
4884-
48854880
"""
48864881
result = self.copy()
48874882

@@ -7115,7 +7110,6 @@ def count(self, axis=0, level=None, numeric_only=False):
71157110
John 2
71167111
Lewis 1
71177112
Myla 1
7118-
71197113
"""
71207114
axis = self._get_axis_number(axis)
71217115
if level is not None:

pandas/core/groupby/generic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,6 @@ class DataFrameGroupBy(NDFrameGroupBy):
12941294
pandas.DataFrame.groupby.apply
12951295
pandas.DataFrame.groupby.transform
12961296
pandas.DataFrame.aggregate
1297-
12981297
""")
12991298

13001299
@Appender(_agg_doc)

pandas/core/groupby/groupby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class providing the base-class of operations.
4242
from pandas.core.sorting import get_group_index_sorter
4343

4444
_doc_template = """
45-
4645
See Also
4746
--------
4847
pandas.Series.%(name)s
@@ -1049,7 +1048,8 @@ def any(self, skipna=True):
10491048
@Substitution(name='groupby')
10501049
@Appender(_doc_template)
10511050
def all(self, skipna=True):
1052-
"""Returns True if all values in the group are truthful, else False
1051+
"""
1052+
Returns True if all values in the group are truthful, else False
10531053
10541054
Parameters
10551055
----------

pandas/core/indexes/base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,6 @@ def to_frame(self, index=True, name=None):
12241224
or the original Index is returned.
12251225
12261226
.. versionadded:: 0.19.0
1227-
12281227
"""
12291228

12301229
@Appender(_index_shared_docs['astype'])
@@ -2539,7 +2538,6 @@ def asof_locs(self, where, mask):
25392538
"""
25402539
where : array of timestamps
25412540
mask : array of booleans where data is not NA
2542-
25432541
"""
25442542
locs = self.values[mask].searchsorted(where.values, side='right')
25452543

@@ -2785,7 +2783,6 @@ def union(self, other):
27852783
>>> idx2 = pd.Index([3, 4, 5, 6])
27862784
>>> idx1.union(idx2)
27872785
Int64Index([1, 2, 3, 4, 5, 6], dtype='int64')
2788-
27892786
"""
27902787
self._assert_can_do_setop(other)
27912788
other = ensure_index(other)
@@ -2884,7 +2881,6 @@ def intersection(self, other):
28842881
>>> idx2 = pd.Index([3, 4, 5, 6])
28852882
>>> idx1.intersection(idx2)
28862883
Int64Index([3, 4], dtype='int64')
2887-
28882884
"""
28892885
self._assert_can_do_setop(other)
28902886
other = ensure_index(other)
@@ -2956,7 +2952,6 @@ def difference(self, other, sort=True):
29562952
Int64Index([1, 2], dtype='int64')
29572953
>>> idx1.difference(idx2, sort=False)
29582954
Int64Index([2, 1], dtype='int64')
2959-
29602955
"""
29612956
self._assert_can_do_setop(other)
29622957

@@ -3342,7 +3337,6 @@ def droplevel(self, level=0):
33423337
33433338
Notice that the return value is an array of locations in ``index``
33443339
and ``x`` is marked by -1, as it is not in ``index``.
3345-
33463340
"""
33473341

33483342
@Appender(_index_shared_docs['get_indexer'] % _index_doc_kwargs)
@@ -4374,7 +4368,6 @@ def get_slice_bound(self, label, side, kind):
43744368
label : object
43754369
side : {'left', 'right'}
43764370
kind : {'ix', 'loc', 'getitem'}
4377-
43784371
"""
43794372
assert kind in ['ix', 'loc', 'getitem', None]
43804373

pandas/core/indexes/category.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
typ='method', overwrite=True)
4343
class CategoricalIndex(Index, accessor.PandasDelegate):
4444
"""
45-
4645
Immutable Index implementing an ordered, sliceable set. CategoricalIndex
4746
represents a sparsely populated Index with an underlying Categorical.
4847

pandas/core/indexes/datetimes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ class DatetimeIndex(DatetimeArray, DatelikeOps, TimelikeOps,
167167
TimedeltaIndex : Index of timedelta64 data.
168168
PeriodIndex : Index of Period data.
169169
pandas.to_datetime : Convert argument to datetime.
170-
171170
"""
172171
_typ = 'datetimeindex'
173172
_join_precedence = 10
@@ -546,7 +545,6 @@ def to_series(self, keep_tz=None, index=None, name=None):
546545
def snap(self, freq='S'):
547546
"""
548547
Snap time stamps to nearest occurring frequency
549-
550548
"""
551549
# Superdumb, punting on any optimizing
552550
freq = to_offset(freq)

pandas/core/indexes/multi.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ def set_levels(self, levels, level=None, inplace=False,
356356
-------
357357
new index (of same type and class...etc)
358358
359-
360359
Examples
361360
--------
362361
>>> idx = pd.MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
@@ -1519,7 +1518,6 @@ def remove_unused_levels(self):
15191518
MultiIndex(levels=[[0, 1], ['a', 'b']],
15201519
labels=[[0, 0, 1, 1], [0, 1, 0, 1]])
15211520
1522-
15231521
>>> i[2:]
15241522
MultiIndex(levels=[[0, 1], ['a', 'b']],
15251523
labels=[[1, 1], [0, 1]])
@@ -1530,7 +1528,6 @@ def remove_unused_levels(self):
15301528
>>> i[2:].remove_unused_levels()
15311529
MultiIndex(levels=[[1], ['a', 'b']],
15321530
labels=[[0, 0], [0, 1]])
1533-
15341531
"""
15351532

15361533
new_levels = []
@@ -1912,7 +1909,6 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True):
19121909
Resulting index
19131910
indexer : np.ndarray
19141911
Indices of output values in original index
1915-
19161912
"""
19171913
from pandas.core.sorting import indexer_from_factorized
19181914

0 commit comments

Comments
 (0)