diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index ecdad8752113a..5f7995ac649a2 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -343,7 +343,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 f4757bfd8069c..6b50ab9ffe7d4 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 33177ac452414..de7e453e80d85 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 5104cf815abf6..8d089ab3a1949 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 @@ -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(...) " @@ -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) @@ -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): @@ -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() @@ -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: 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 d2dc5f16de7f8..b68fdf853ab19 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 @@ -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 ---------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 29fb541991389..28aefb652adb0 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -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']) @@ -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') @@ -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) @@ -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) @@ -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) @@ -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) @@ -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] diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index 86269c7795d35..f05b0fdd4a323 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -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. diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 04a4669cc1a24..6b66170e978ed 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -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 @@ -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) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 0e3fd201d8ddb..f9483b48b5261 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -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'), @@ -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]]) @@ -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 = [] @@ -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 diff --git a/pandas/core/panel.py b/pandas/core/panel.py index bf076b306a9ad..90016f599addc 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -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 ` - """ return self.xs(key, axis=self._AXIS_LEN - 2) @@ -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 ` - """ return self.xs(key, axis=self._AXIS_LEN - 1) @@ -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 ` - """ axis = self._get_axis_number(axis) if axis == 0: diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 4f0669a568ae7..125b441e5558a 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 0e58b69465d3c..4be70c530b6b6 100644 --- a/pandas/core/util/hashing.py +++ b/pandas/core/util/hashing.py @@ -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: @@ -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'): diff --git a/pandas/core/window.py b/pandas/core/window.py index 494ab5d5963ee..4c67b04e89ba8 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -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 @@ -1631,7 +1630,6 @@ def _validate_freq(self): -------- pandas.Series.rolling pandas.DataFrame.rolling - """) @Appender(_agg_doc) @@ -1908,7 +1906,6 @@ def _get_window(self, other=None): pandas.DataFrame.expanding.aggregate pandas.DataFrame.rolling.aggregate pandas.DataFrame.aggregate - """) @Appender(_agg_doc) @@ -2209,7 +2206,6 @@ def _constructor(self): See Also -------- pandas.DataFrame.rolling.aggregate - """) @Appender(_agg_doc) @@ -2233,7 +2229,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 a084a9a12133c..2c018598a6a6e 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -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)) @@ -672,7 +671,6 @@ def where(self, cond, value, other=None, subset=None, **kwargs): See Also -------- Styler.applymap - """ if other is None: @@ -1104,7 +1102,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 19a0b08d8fdda..cec7908f143a8 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 8170e3b6aea75..4e52c35c6b1e6 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 c01cf6e95ad1f..ab1c89ef828d0 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 92963126edf01..08a35683cbcf7 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 ca81b3bcfef2a..ee8c6fc10209d 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -778,7 +778,6 @@ class BusinessHour(BusinessHourMixin, SingleConstructorOffset): DateOffset subclass representing possibly n business days .. versionadded:: 0.16.1 - """ _prefix = 'BH' _anchor = 0 @@ -863,7 +862,6 @@ class CustomBusinessHour(_CustomMixin, BusinessHourMixin, DateOffset subclass representing possibly n custom business days .. versionadded:: 0.18.1 - """ _prefix = 'CBH' _anchor = 0 @@ -1469,7 +1467,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 818c7a51becdf..46d6a3cdf4a8d 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)