Skip to content

Commit a5a4873

Browse files
committed
DOC: Remove duplicate sections
1 parent fc4a65e commit a5a4873

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
@@ -238,15 +238,13 @@ _no_input = object()
238238

239239

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

278289
@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)