From 050fb2f38b58dca2c9d7baa02af6fc48c4b4d255 Mon Sep 17 00:00:00 2001 From: Alexander Ponomaroff Date: Fri, 23 Nov 2018 10:40:53 -0500 Subject: [PATCH] Fix: Use only one blank line to separate sections or paragraphs --- pandas/core/algorithms.py | 1 - pandas/core/config.py | 1 - pandas/core/dtypes/common.py | 1 - pandas/core/frame.py | 6 ------ pandas/core/groupby/generic.py | 1 - pandas/core/groupby/groupby.py | 4 ++-- pandas/core/indexes/base.py | 7 ------- pandas/core/indexes/category.py | 1 - pandas/core/indexes/datetimes.py | 2 -- pandas/core/indexes/multi.py | 4 ---- pandas/core/panel.py | 3 --- pandas/core/resample.py | 3 --- pandas/core/reshape/merge.py | 3 --- pandas/core/reshape/pivot.py | 1 - pandas/core/util/hashing.py | 2 -- pandas/core/window.py | 5 ----- pandas/errors/__init__.py | 1 - pandas/io/formats/style.py | 3 --- pandas/io/json/normalize.py | 1 - pandas/io/packers.py | 1 - pandas/io/parquet.py | 1 - pandas/io/pytables.py | 2 -- pandas/io/sql.py | 4 ---- pandas/plotting/_core.py | 1 - pandas/tseries/offsets.py | 3 --- pandas/util/_decorators.py | 1 - 26 files changed, 2 insertions(+), 61 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index df2da26685a16..8d36f28d4919b 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -352,7 +352,6 @@ def unique(values): -------- pandas.Index.unique pandas.Series.unique - """ values = _ensure_arraylike(values) diff --git a/pandas/core/config.py b/pandas/core/config.py index f178600b74626..303de0e9fb0c0 100644 --- a/pandas/core/config.py +++ b/pandas/core/config.py @@ -385,7 +385,6 @@ class option_context(object): >>> with option_context('display.max_rows', 10, 'display.max_columns', 5): ... ... - """ def __init__(self, *args): diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index a01266870b8fc..1de2281a04e69 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -2067,7 +2067,6 @@ def pandas_dtype(dtype): Raises ------ TypeError if not a dtype - """ # short-circuit if isinstance(dtype, np.ndarray): diff --git a/pandas/core/frame.py b/pandas/core/frame.py index e313e0f37a445..4b587d8b0eb34 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -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 @@ -1701,7 +1700,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(...) " @@ -1951,7 +1949,6 @@ def to_feather(self, fname): ---------- fname : str string file path - """ from pandas.io.feather_format import to_feather to_feather(self, fname) @@ -3564,7 +3561,6 @@ def lookup(self, row_labels, col_labels): -------- values : ndarray The found values - """ n = len(row_labels) if n != len(col_labels): @@ -4867,7 +4863,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() @@ -7101,7 +7096,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: diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index ee84f8cda07d0..ada9c5d456a77 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -1294,7 +1294,6 @@ class DataFrameGroupBy(NDFrameGroupBy): pandas.DataFrame.groupby.apply pandas.DataFrame.groupby.transform pandas.DataFrame.aggregate - """) @Appender(_agg_doc) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 96aff09126772..02c2d5853acfe 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -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 @@ -1048,7 +1047,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 ---------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 0632198c77262..763b90ad00989 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1242,7 +1242,6 @@ def to_frame(self, index=True, name=None): or the original Index is returned. .. versionadded:: 0.19.0 - """ @Appender(_index_shared_docs['astype']) @@ -2555,7 +2554,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') @@ -2801,7 +2799,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) @@ -2900,7 +2897,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) @@ -2967,7 +2963,6 @@ def difference(self, other): >>> idx2 = pd.Index([3, 4, 5, 6]) >>> idx1.difference(idx2) Int64Index([1, 2], dtype='int64') - """ self._assert_can_do_setop(other) @@ -3352,7 +3347,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) @@ -4384,7 +4378,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] diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index 6e2f0b00fcd6e..9fdd8226de497 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -45,7 +45,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. diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 75f990096c677..0703227a7e236 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -168,7 +168,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 @@ -547,7 +546,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) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index dbb1b8e196bf7..446a623238c9b 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -366,7 +366,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'), @@ -1529,7 +1528,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]]) @@ -1540,7 +1538,6 @@ def remove_unused_levels(self): >>> i[2:].remove_unused_levels() MultiIndex(levels=[[1], ['a', 'b']], labels=[[0, 0], [0, 1]]) - """ new_levels = [] @@ -1922,7 +1919,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 diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 5ae7848b5adc6..66063f5b34a3b 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -805,7 +805,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 ` - """ return self.xs(key, axis=self._AXIS_LEN - 2) @@ -830,7 +829,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 ` - """ return self.xs(key, axis=self._AXIS_LEN - 1) @@ -855,7 +853,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 ` - """ axis = self._get_axis_number(axis) if axis == 0: diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 0a275c7a3575b..76e96f86821e9 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -110,7 +110,6 @@ def __iter__(self): See Also -------- GroupBy.__iter__ - """ self._set_binner() return super(Resampler, self).__iter__() @@ -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], @@ -244,7 +242,6 @@ def pipe(self, func, *args, **kwargs): pandas.DataFrame.groupby.aggregate pandas.DataFrame.resample.transform pandas.DataFrame.aggregate - """) @Appender(_agg_doc) diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 93a6e4538cbc1..a7e83c88cd355 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -203,7 +203,6 @@ def merge_ordered(left, right, on=None, -------- merge merge_asof - """ def _merger(x, y): # perform the ordered merge operation @@ -312,7 +311,6 @@ def merge_asof(left, right, on=None, .. versionadded:: 0.20.0 - Returns ------- merged : DataFrame @@ -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, diff --git a/pandas/core/reshape/pivot.py b/pandas/core/reshape/pivot.py index d12dbb81765d8..84faab017163f 100644 --- a/pandas/core/reshape/pivot.py +++ b/pandas/core/reshape/pivot.py @@ -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 diff --git a/pandas/core/util/hashing.py b/pandas/core/util/hashing.py index 6a2cfd4d4a7b3..51da24784f4d3 100644 --- a/pandas/core/util/hashing.py +++ b/pandas/core/util/hashing.py @@ -70,7 +70,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: @@ -249,7 +248,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'): diff --git a/pandas/core/window.py b/pandas/core/window.py index f7a60527602a1..68f68227af842 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -1625,7 +1625,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 @@ -1643,7 +1642,6 @@ def _validate_freq(self): -------- pandas.Series.rolling pandas.DataFrame.rolling - """) @Appender(_agg_doc) @@ -1920,7 +1918,6 @@ def _get_window(self, other=None): pandas.DataFrame.expanding.aggregate pandas.DataFrame.rolling.aggregate pandas.DataFrame.aggregate - """) @Appender(_agg_doc) @@ -2221,7 +2218,6 @@ def _constructor(self): See Also -------- pandas.DataFrame.rolling.aggregate - """) @Appender(_agg_doc) @@ -2245,7 +2241,6 @@ def _apply(self, func, **kwargs): Returns ------- y : same type as input argument - """ blocks, obj, index = self._create_blocks() results = [] diff --git a/pandas/errors/__init__.py b/pandas/errors/__init__.py index b080ab00972c6..eb6a4674a7497 100644 --- a/pandas/errors/__init__.py +++ b/pandas/errors/__init__.py @@ -26,7 +26,6 @@ class UnsortedIndexError(KeyError): and the index has not been lexsorted. Subclass of `KeyError`. .. versionadded:: 0.20.0 - """ diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 8291e0ac98cd1..478b0b81b3269 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -639,7 +639,6 @@ def applymap(self, func, subset=None, **kwargs): See Also -------- Styler.where - """ self._todo.append((lambda instance: getattr(instance, '_applymap'), (func, subset), kwargs)) @@ -674,7 +673,6 @@ def where(self, cond, value, other=None, subset=None, **kwargs): See Also -------- Styler.applymap - """ if other is None: @@ -1106,7 +1104,6 @@ def bar(self, subset=None, axis=0, color='#d65f5f', width=100, .. versionadded:: 0.24.0 - Returns ------- self : Styler diff --git a/pandas/io/json/normalize.py b/pandas/io/json/normalize.py index af046d9f309e7..3e3f125b56d88 100644 --- a/pandas/io/json/normalize.py +++ b/pandas/io/json/normalize.py @@ -129,7 +129,6 @@ def json_normalize(data, record_path=None, meta=None, .. versionadded:: 0.20.0 - Returns ------- frame : DataFrame diff --git a/pandas/io/packers.py b/pandas/io/packers.py index ea673101e90b3..c813a070a84d8 100644 --- a/pandas/io/packers.py +++ b/pandas/io/packers.py @@ -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: diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index aad59f9805a3b..fb7a7d4ca2cdb 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -276,7 +276,6 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): Returns ------- DataFrame - """ impl = get_engine(engine) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 8c574bcb70363..ff6f3b2039981 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -709,7 +709,6 @@ def select(self, key, where=None, start=None, stop=None, columns=None, Returns ------- The selected object - """ group = self.get_node(key) if group is None: @@ -1126,7 +1125,6 @@ def walk(self, where="/"): names of the groups contained in `path` leaves : list of str names of the pandas objects contained in `path` - """ _tables() self._check_if_open() diff --git a/pandas/io/sql.py b/pandas/io/sql.py index a81bc11130153..e65e3dff1936a 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -226,7 +226,6 @@ def read_sql_table(table_name, con, schema=None, index_col=None, -------- read_sql_query : Read SQL query into a DataFrame. read_sql - """ con = _engine_builder(con) @@ -306,7 +305,6 @@ def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, -------- read_sql_table : Read SQL database table into a DataFrame. read_sql - """ pandas_sql = pandasSQL_builder(con) return pandas_sql.read_query( @@ -370,7 +368,6 @@ def read_sql(sql, con, index_col=None, coerce_float=True, params=None, -------- read_sql_table : Read SQL database table into a DataFrame. read_sql_query : Read SQL query into a DataFrame. - """ pandas_sql = pandasSQL_builder(con) @@ -432,7 +429,6 @@ def to_sql(frame, name, con, schema=None, if_exists='fail', index=True, Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. If all columns are of the same type, one single value can be used. - """ if if_exists not in ('fail', 'replace', 'append'): raise ValueError("'{0}' is not valid for if_exists".format(if_exists)) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 9e07be5e1769e..7d8aa60493db7 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -3436,7 +3436,6 @@ def pie(self, y=None, **kwds): :context: close-figs >>> plot = df.plot.pie(subplots=True, figsize=(6, 3)) - """ return self(kind='pie', y=y, **kwds) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 067a7d4622ca2..4fd7717b22533 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -787,7 +787,6 @@ class BusinessHour(BusinessHourMixin, SingleConstructorOffset): DateOffset subclass representing possibly n business days .. versionadded:: 0.16.1 - """ _prefix = 'BH' _anchor = 0 @@ -872,7 +871,6 @@ class CustomBusinessHour(_CustomMixin, BusinessHourMixin, DateOffset subclass representing possibly n custom business days .. versionadded:: 0.18.1 - """ _prefix = 'CBH' _anchor = 0 @@ -1478,7 +1476,6 @@ class LastWeekOfMonth(_WeekOfMonthMixin, DateOffset): 4: Fridays 5: Saturdays 6: Sundays - """ _prefix = 'LWOM' _adjust_dst = True diff --git a/pandas/util/_decorators.py b/pandas/util/_decorators.py index 638282f322c74..b98e4fd6a761a 100644 --- a/pandas/util/_decorators.py +++ b/pandas/util/_decorators.py @@ -107,7 +107,6 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2): warnings.warn(msg, FutureWarning) yes! - To raise a warning that a keyword will be removed entirely in the future >>> @deprecate_kwarg(old_arg_name='cols', new_arg_name=None)