diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index 99f0d77e9bd34..a81941da4a05a 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -512,8 +512,8 @@ class NaTType(_NaT): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -550,8 +550,8 @@ class NaTType(_NaT): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -584,8 +584,8 @@ class NaTType(_NaT): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -648,8 +648,8 @@ class NaTType(_NaT): - 'NaT' will return NaT for an ambiguous time - 'raise' will raise an AmbiguousTimeError for an ambiguous time - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index c666178b11512..eb676d2265f9f 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -455,8 +455,8 @@ class Timestamp(_Timestamp): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -497,8 +497,8 @@ class Timestamp(_Timestamp): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -533,8 +533,8 @@ class Timestamp(_Timestamp): - 'raise' will raise an AmbiguousTimeError for an ambiguous time .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. @@ -786,8 +786,8 @@ class Timestamp(_Timestamp): - 'NaT' will return NaT for an ambiguous time - 'raise' will raise an AmbiguousTimeError for an ambiguous time - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. diff --git a/pandas/_libs/tslibs/tzconversion.pyx b/pandas/_libs/tslibs/tzconversion.pyx index 50a35cea2ba91..26a64c13f6de1 100644 --- a/pandas/_libs/tslibs/tzconversion.pyx +++ b/pandas/_libs/tslibs/tzconversion.pyx @@ -53,8 +53,8 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None, - bool if True, treat all vals as DST. If False, treat them as non-DST - 'NaT' will return NaT where there are ambiguous times - nonexistent : {None, "NaT", "shift_forward", "shift_backward", "raise", - timedelta-like} + nonexistent : {None, "NaT", "shift_forward", "shift_backward", "raise", \ +timedelta-like} How to handle non-existent times when converting wall times to UTC .. versionadded:: 0.24.0 diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 6225dfcbe5c14..15a675a92d279 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -211,8 +211,8 @@ class TimelikeOps(object): .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 272c6ef4f9267..09a3d53efdd07 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -895,8 +895,8 @@ def tz_localize(self, tz, ambiguous='raise', nonexistent='raise', - 'raise' will raise an AmbiguousTimeError if there are ambiguous times - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ +default 'raise' A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST. diff --git a/pandas/core/frame.py b/pandas/core/frame.py index bee8234907aba..48922ee870b8e 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6311,7 +6311,7 @@ def _gotitem(self, @Substitution(see_also=_agg_summary_and_see_also_doc, examples=_agg_examples_doc, - versionadded='.. versionadded:: 0.20.0', + versionadded='\n.. versionadded:: 0.20.0\n', **_shared_doc_kwargs) @Appender(_shared_docs['aggregate']) def aggregate(self, func, axis=0, *args, **kwargs): diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index d17f2d0c3b0a9..3519b5c078ee2 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -1534,7 +1534,8 @@ def nunique(self, dropna=True): ham 1 1 2 spam 1 2 1 - # check for rows with the same id but conflicting values + Check for rows with the same id but conflicting values: + >>> df.groupby('id').filter(lambda g: (g.nunique() > 1).any()) id value1 value2 0 spam 1 a diff --git a/pandas/core/series.py b/pandas/core/series.py index b382c963f6006..34088e86cf80a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3514,7 +3514,7 @@ def _gotitem(self, key, ndim, subset=None): @Substitution(see_also=_agg_see_also_doc, examples=_agg_examples_doc, - versionadded='.. versionadded:: 0.20.0', + versionadded='\n.. versionadded:: 0.20.0\n', **_shared_doc_kwargs) @Appender(generic._shared_docs['aggregate']) def aggregate(self, func, axis=0, *args, **kwargs): diff --git a/pandas/core/window.py b/pandas/core/window.py index 416647831880d..eb65ca7a92584 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -2127,8 +2127,7 @@ class EWM(_Rolling): :math:`\alpha = 2 / (span + 1),\text{ for } span \geq 1`. halflife : float, optional Specify decay in terms of half-life, - :math:`\alpha = 1 - exp(log(0.5) / halflife),\text{ for } - halflife > 0`. + :math:`\alpha = 1 - exp(log(0.5) / halflife),\text{for} halflife > 0`. alpha : float, optional Specify smoothing factor :math:`\alpha` directly, :math:`0 < \alpha \leq 1`. diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index a21c910979f9d..ac55583274ab1 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -727,7 +727,7 @@ def parser_f(filepath_or_buffer: FilePathOrBuffer, summary="""Read general delimited file into DataFrame. .. deprecated:: 0.24.0 -Use :func:`pandas.read_csv` instead, passing ``sep='\\t'`` if necessary.""", + Use :func:`pandas.read_csv` instead, passing ``sep='\\t'`` if necessary.""", _default_sep=r"'\\t' (tab-stop)") )(read_table) diff --git a/pandas/io/sql.py b/pandas/io/sql.py index d91b2785c4fe5..789b6ca7e97bd 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -188,7 +188,6 @@ def read_sql_table(table_name, con, schema=None, index_col=None, Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Can result in loss of Precision. parse_dates : list or dict, default None - The behavior is as follows: - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times or is one of diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index c6ae933bbbf10..e36e9ffdac633 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2088,15 +2088,15 @@ def plot_series(data, kind='line', ax=None, # Series unique ----- The return type depends on the `return_type` parameter: - * 'axes' : object of class matplotlib.axes.Axes - * 'dict' : dict of matplotlib.lines.Line2D objects - * 'both' : a namedtuple with structure (ax, lines) + * 'axes' : object of class matplotlib.axes.Axes + * 'dict' : dict of matplotlib.lines.Line2D objects + * 'both' : a namedtuple with structure (ax, lines) - For data grouped with ``by``: + For data grouped with ``by``, return a Series of the above or a numpy + array: - * :class:`~pandas.Series` - * :class:`~numpy.array` (for ``return_type = None``) - Return Series or numpy.array. + * :class:`~pandas.Series` + * :class:`~numpy.array` (for ``return_type = None``) Use ``return_type='dict'`` when you want to tweak the appearance of the lines after plotting. In this case a dict containing the Lines