Skip to content

Commit 80d150a

Browse files
jorisvandenbosschejreback
authored andcommitted
DOC: bunch of docstring formatting fixes (sphinx warnings) (#26117)
1 parent 057b242 commit 80d150a

File tree

12 files changed

+35
-36
lines changed

12 files changed

+35
-36
lines changed

pandas/_libs/tslibs/nattype.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ class NaTType(_NaT):
512512
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
513513
514514
.. versionadded:: 0.24.0
515-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
516-
default 'raise'
515+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
516+
default 'raise'
517517
A nonexistent time does not exist in a particular timezone
518518
where clocks moved forward due to DST.
519519
@@ -550,8 +550,8 @@ class NaTType(_NaT):
550550
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
551551
552552
.. versionadded:: 0.24.0
553-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
554-
default 'raise'
553+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
554+
default 'raise'
555555
A nonexistent time does not exist in a particular timezone
556556
where clocks moved forward due to DST.
557557
@@ -584,8 +584,8 @@ class NaTType(_NaT):
584584
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
585585
586586
.. versionadded:: 0.24.0
587-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
588-
default 'raise'
587+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
588+
default 'raise'
589589
A nonexistent time does not exist in a particular timezone
590590
where clocks moved forward due to DST.
591591
@@ -648,8 +648,8 @@ class NaTType(_NaT):
648648
- 'NaT' will return NaT for an ambiguous time
649649
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
650650
651-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
652-
default 'raise'
651+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
652+
default 'raise'
653653
A nonexistent time does not exist in a particular timezone
654654
where clocks moved forward due to DST.
655655

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ class Timestamp(_Timestamp):
455455
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
456456
457457
.. versionadded:: 0.24.0
458-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
459-
default 'raise'
458+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
459+
default 'raise'
460460
A nonexistent time does not exist in a particular timezone
461461
where clocks moved forward due to DST.
462462
@@ -497,8 +497,8 @@ class Timestamp(_Timestamp):
497497
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
498498
499499
.. versionadded:: 0.24.0
500-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
501-
default 'raise'
500+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
501+
default 'raise'
502502
A nonexistent time does not exist in a particular timezone
503503
where clocks moved forward due to DST.
504504
@@ -533,8 +533,8 @@ class Timestamp(_Timestamp):
533533
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
534534
535535
.. versionadded:: 0.24.0
536-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
537-
default 'raise'
536+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
537+
default 'raise'
538538
A nonexistent time does not exist in a particular timezone
539539
where clocks moved forward due to DST.
540540
@@ -786,8 +786,8 @@ class Timestamp(_Timestamp):
786786
- 'NaT' will return NaT for an ambiguous time
787787
- 'raise' will raise an AmbiguousTimeError for an ambiguous time
788788
789-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
790-
default 'raise'
789+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
790+
default 'raise'
791791
A nonexistent time does not exist in a particular timezone
792792
where clocks moved forward due to DST.
793793

pandas/_libs/tslibs/tzconversion.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
5353
- bool if True, treat all vals as DST. If False, treat them as non-DST
5454
- 'NaT' will return NaT where there are ambiguous times
5555
56-
nonexistent : {None, "NaT", "shift_forward", "shift_backward", "raise",
57-
timedelta-like}
56+
nonexistent : {None, "NaT", "shift_forward", "shift_backward", "raise", \
57+
timedelta-like}
5858
How to handle non-existent times when converting wall times to UTC
5959
6060
.. versionadded:: 0.24.0

pandas/core/arrays/datetimelike.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ class TimelikeOps(object):
211211
212212
.. versionadded:: 0.24.0
213213
214-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
215-
default 'raise'
214+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
215+
default 'raise'
216216
A nonexistent time does not exist in a particular timezone
217217
where clocks moved forward due to DST.
218218

pandas/core/arrays/datetimes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,8 @@ def tz_localize(self, tz, ambiguous='raise', nonexistent='raise',
895895
- 'raise' will raise an AmbiguousTimeError if there are ambiguous
896896
times
897897
898-
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta,
899-
default 'raise'
898+
nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \
899+
default 'raise'
900900
A nonexistent time does not exist in a particular timezone
901901
where clocks moved forward due to DST.
902902

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6311,7 +6311,7 @@ def _gotitem(self,
63116311

63126312
@Substitution(see_also=_agg_summary_and_see_also_doc,
63136313
examples=_agg_examples_doc,
6314-
versionadded='.. versionadded:: 0.20.0',
6314+
versionadded='\n.. versionadded:: 0.20.0\n',
63156315
**_shared_doc_kwargs)
63166316
@Appender(_shared_docs['aggregate'])
63176317
def aggregate(self, func, axis=0, *args, **kwargs):

pandas/core/groupby/generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,8 @@ def nunique(self, dropna=True):
15341534
ham 1 1 2
15351535
spam 1 2 1
15361536
1537-
# check for rows with the same id but conflicting values
1537+
Check for rows with the same id but conflicting values:
1538+
15381539
>>> df.groupby('id').filter(lambda g: (g.nunique() > 1).any())
15391540
id value1 value2
15401541
0 spam 1 a

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3514,7 +3514,7 @@ def _gotitem(self, key, ndim, subset=None):
35143514

35153515
@Substitution(see_also=_agg_see_also_doc,
35163516
examples=_agg_examples_doc,
3517-
versionadded='.. versionadded:: 0.20.0',
3517+
versionadded='\n.. versionadded:: 0.20.0\n',
35183518
**_shared_doc_kwargs)
35193519
@Appender(generic._shared_docs['aggregate'])
35203520
def aggregate(self, func, axis=0, *args, **kwargs):

pandas/core/window.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,8 +2127,7 @@ class EWM(_Rolling):
21272127
:math:`\alpha = 2 / (span + 1),\text{ for } span \geq 1`.
21282128
halflife : float, optional
21292129
Specify decay in terms of half-life,
2130-
:math:`\alpha = 1 - exp(log(0.5) / halflife),\text{ for }
2131-
halflife > 0`.
2130+
:math:`\alpha = 1 - exp(log(0.5) / halflife),\text{for} halflife > 0`.
21322131
alpha : float, optional
21332132
Specify smoothing factor :math:`\alpha` directly,
21342133
:math:`0 < \alpha \leq 1`.

pandas/io/parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def parser_f(filepath_or_buffer: FilePathOrBuffer,
727727
summary="""Read general delimited file into DataFrame.
728728
729729
.. deprecated:: 0.24.0
730-
Use :func:`pandas.read_csv` instead, passing ``sep='\\t'`` if necessary.""",
730+
Use :func:`pandas.read_csv` instead, passing ``sep='\\t'`` if necessary.""",
731731
_default_sep=r"'\\t' (tab-stop)")
732732
)(read_table)
733733

0 commit comments

Comments
 (0)