Skip to content

Commit 4e79b84

Browse files
committed
DOC: Remove duplicate sections
1 parent da3b069 commit 4e79b84

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

pandas/_libs/tslib.pyx

+24-13
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,13 @@ _no_input = object()
239239

240240

241241
class Timestamp(_Timestamp):
242-
"""TimeStamp is the pandas equivalent of python's Datetime
242+
"""Pandas replacement for datetime.datetime
243+
244+
TimeStamp is the pandas equivalent of python's Datetime
243245
and is interchangable with it in most cases. It's the type used
244246
for the entries that make up a DatetimeIndex, and other timeseries
245247
oriented data structures in pandas.
246248
247-
There are essentially three calling conventions for the constructor. The
248-
primary form accepts four parameters. They can be passed by position or
249-
keyword.
250-
251249
Parameters
252250
----------
253251
ts_input : datetime-like, str, int, float
@@ -261,19 +259,32 @@ class Timestamp(_Timestamp):
261259
offset : str, DateOffset
262260
Deprecated, use freq
263261
262+
year, month, day : int
263+
.. versionadded:: 0.19.0
264+
hour, minute, second, microsecond : int, optional, default 0
265+
.. versionadded:: 0.19.0
266+
tzinfo : datetime.tzinfo, optional, default None
267+
.. versionadded:: 0.19.0
268+
269+
Notes
270+
-----
271+
There are essentially three calling conventions for the constructor. The
272+
primary form accepts four parameters. They can be passed by position or
273+
keyword.
274+
264275
The other two forms mimic the parameters from ``datetime.datetime``. They
265276
can be passed by either position or keyword, but not both mixed together.
266277
267-
Parameters
268-
----------
278+
Examples
279+
--------
280+
>>> pd.Timestamp('2017-01-01T12')
281+
Timestamp('2017-01-01 12:00:00')
269282
270-
.. versionadded:: 0.19.0
283+
>>> pd.Timestamp(2017, 1, 1, 12)
284+
Timestamp('2017-01-01 12:00:00')
271285
272-
year : int
273-
month : int
274-
day : int
275-
hour, minute, second, microsecond : int, optional, default 0
276-
tzinfo : datetime.tzinfo, optional, default None
286+
>>> pd.Timestamp(year=2017, month=1, day=1, hour=12)
287+
Timestamp('2017-01-01 12:00:00')
277288
"""
278289

279290
@classmethod

pandas/core/groupby.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,6 @@ def expanding(self, *args, **kwargs):
12571257
return ExpandingGroupby(self, *args, **kwargs)
12581258

12591259
@Substitution(name='groupby')
1260-
@Appender(_doc_template)
12611260
def pad(self, limit=None):
12621261
"""
12631262
Forward fill the values
@@ -1269,14 +1268,15 @@ def pad(self, limit=None):
12691268
12701269
See Also
12711270
--------
1271+
Series.pad
1272+
DataFrame.pad
12721273
Series.fillna
12731274
DataFrame.fillna
12741275
"""
12751276
return self.apply(lambda x: x.ffill(limit=limit))
12761277
ffill = pad
12771278

12781279
@Substitution(name='groupby')
1279-
@Appender(_doc_template)
12801280
def backfill(self, limit=None):
12811281
"""
12821282
Backward fill the values
@@ -1288,6 +1288,8 @@ def backfill(self, limit=None):
12881288
12891289
See Also
12901290
--------
1291+
Series.backfill
1292+
DataFrame.backfill
12911293
Series.fillna
12921294
DataFrame.fillna
12931295
"""
@@ -1450,7 +1452,6 @@ def nth(self, n, dropna=None):
14501452
return result
14511453

14521454
@Substitution(name='groupby')
1453-
@Appender(_doc_template)
14541455
def ngroup(self, ascending=True):
14551456
"""
14561457
Number each group from 0 to the number of groups - 1.
@@ -1507,7 +1508,6 @@ def ngroup(self, ascending=True):
15071508
See also
15081509
--------
15091510
.cumcount : Number the rows in each group.
1510-
15111511
"""
15121512

15131513
self._set_group_selection()
@@ -1519,7 +1519,6 @@ def ngroup(self, ascending=True):
15191519
return result
15201520

15211521
@Substitution(name='groupby')
1522-
@Appender(_doc_template)
15231522
def cumcount(self, ascending=True):
15241523
"""
15251524
Number each item in each group from 0 to the length of that group - 1.

0 commit comments

Comments
 (0)