Skip to content

Commit

Permalink
DOC: update the pandas.Index.drop_duplicates and pandas.Series.drop_d…
Browse files Browse the repository at this point in the history
…uplicates docstring (pandas-dev#20114)
  • Loading branch information
DaanVanHauwermeiren authored and pandres committed Mar 15, 2018
1 parent 802848c commit d50c0aa
Show file tree
Hide file tree
Showing 5 changed files with 5,263 additions and 22 deletions.
18 changes: 0 additions & 18 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,24 +1184,6 @@ def searchsorted(self, value, side='left', sorter=None):
# needs coercion on the key (DatetimeIndex does already)
return self.values.searchsorted(value, side=side, sorter=sorter)

_shared_docs['drop_duplicates'] = (
"""Return %(klass)s with duplicate values removed
Parameters
----------
keep : {'first', 'last', False}, default 'first'
- ``first`` : Drop duplicates except for the first occurrence.
- ``last`` : Drop duplicates except for the last occurrence.
- False : Drop all duplicates.
%(inplace)s
Returns
-------
deduplicated : %(klass)s
""")

@Appender(_shared_docs['drop_duplicates'] % _indexops_doc_kwargs)
def drop_duplicates(self, keep='first', inplace=False):
inplace = validate_bool_kwarg(inplace, 'inplace')
if isinstance(self, ABCIndexClass):
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,8 @@ def describe(self, **kwargs):
@Substitution(name='groupby')
@Appender(_doc_template)
def resample(self, rule, *args, **kwargs):
"""Provide resampling when using a TimeGrouper.
"""
Provide resampling when using a TimeGrouper.
Given a grouper the function resamples it according to a string and an
optional list and dictionary of parameters. Returns a new grouper with
Expand All @@ -1501,7 +1502,6 @@ def resample(self, rule, *args, **kwargs):
Examples
--------
Start by creating a DataFrame with 9 one minute timestamps.
>>> idx = pd.date_range('1/1/2000', periods=9, freq='T')
Expand Down
Loading

0 comments on commit d50c0aa

Please sign in to comment.