Skip to content

Commit f80197a

Browse files
committed
DOC: Remove duplicate sections
1 parent ae4f942 commit f80197a

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

238238

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

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