Skip to content

Commit 177e7b9

Browse files
jorisvandenbosscheyhaque1213
authored andcommitted
DOC: bunch of docstring formatting fixes (sphinx warnings) (pandas-dev#26117)
1 parent 83553f4 commit 177e7b9

File tree

12 files changed

+35
-36
lines changed

12 files changed

+35
-36
lines changed

pandas/_libs/tslibs/nattype.pyx

+8-8
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

+8-8
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

+2-2
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

+2-2
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

+2-2
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

+1-1
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

+2-1
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

+1-1
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

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

pandas/io/parsers.py

+1-1
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

pandas/io/sql.py

-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ def read_sql_table(table_name, con, schema=None, index_col=None,
188188
Attempts to convert values of non-string, non-numeric objects (like
189189
decimal.Decimal) to floating point. Can result in loss of Precision.
190190
parse_dates : list or dict, default None
191-
The behavior is as follows:
192191
- List of column names to parse as dates.
193192
- Dict of ``{column_name: format string}`` where format string is
194193
strftime compatible in case of parsing string times or is one of

pandas/plotting/_core.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2088,15 +2088,15 @@ def plot_series(data, kind='line', ax=None, # Series unique
20882088
-----
20892089
The return type depends on the `return_type` parameter:
20902090
2091-
* 'axes' : object of class matplotlib.axes.Axes
2092-
* 'dict' : dict of matplotlib.lines.Line2D objects
2093-
* 'both' : a namedtuple with structure (ax, lines)
2091+
* 'axes' : object of class matplotlib.axes.Axes
2092+
* 'dict' : dict of matplotlib.lines.Line2D objects
2093+
* 'both' : a namedtuple with structure (ax, lines)
20942094
2095-
For data grouped with ``by``:
2095+
For data grouped with ``by``, return a Series of the above or a numpy
2096+
array:
20962097
2097-
* :class:`~pandas.Series`
2098-
* :class:`~numpy.array` (for ``return_type = None``)
2099-
Return Series or numpy.array.
2098+
* :class:`~pandas.Series`
2099+
* :class:`~numpy.array` (for ``return_type = None``)
21002100
21012101
Use ``return_type='dict'`` when you want to tweak the appearance
21022102
of the lines after plotting. In this case a dict containing the Lines

0 commit comments

Comments
 (0)