diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index 79beeb0022307..92f62a812d23b 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -472,6 +472,7 @@ strings and apply several methods to it. These can be accessed like Series.str Series.cat Series.dt + Series.sparse Index.str .. _api.series.cat: diff --git a/doc/source/user_guide/missing_data.rst b/doc/source/user_guide/missing_data.rst index 7883814e91c94..e8fb2b135fd61 100644 --- a/doc/source/user_guide/missing_data.rst +++ b/doc/source/user_guide/missing_data.rst @@ -466,7 +466,7 @@ at the new values. .. _missing_data.interp_limits: Interpolation Limits -^^^^^^^^^^^^^^^^^^^^ +-------------------- Like other pandas fill methods, :meth:`~DataFrame.interpolate` accepts a ``limit`` keyword argument. Use this argument to limit the number of consecutive ``NaN`` values diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 28bf46cd4c583..8ad78a68977ad 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -705,7 +705,7 @@ handling of NaN: you can use ``df["cat_col"] = pd.Categorical(df["col"])`` or ``df["cat_col"] = df["col"].astype("category")``. For full docs on :class:`~pandas.Categorical`, see the :ref:`Categorical introduction ` and the - :ref:`API documentation `. + :ref:`API documentation `. Examples -------- diff --git a/doc/source/whatsnew/v0.20.0.rst b/doc/source/whatsnew/v0.20.0.rst index 6a88a5810eca4..55b5f12d3ea70 100644 --- a/doc/source/whatsnew/v0.20.0.rst +++ b/doc/source/whatsnew/v0.20.0.rst @@ -396,7 +396,7 @@ IntervalIndex pandas has gained an ``IntervalIndex`` with its own dtype, ``interval`` as well as the ``Interval`` scalar type. These allow first-class support for interval notation, specifically as a return type for the categories in :func:`cut` and :func:`qcut`. The ``IntervalIndex`` allows some unique indexing, see the -:ref:`docs `. (:issue:`7640`, :issue:`8625`) +:ref:`docs `. (:issue:`7640`, :issue:`8625`) .. warning:: @@ -1564,7 +1564,7 @@ Removal of prior version deprecations/changes - The ``pandas.rpy`` module is removed. Similar functionality can be accessed through the `rpy2 `__ project. - See the :ref:`R interfacing docs ` for more details. + See the :ref:`R interfacing docs `__ for more details. - The ``pandas.io.ga`` module with a ``google-analytics`` interface is removed (:issue:`11308`). Similar functionality can be found in the `Google2Pandas `__ package. - ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`) diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index 8d8f1d312b784..6d850095510d0 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -72,7 +72,7 @@ column selection, the values can just be the functions to apply This type of aggregation is the recommended alternative to the deprecated behavior when passing a dict to a Series groupby aggregation (:ref:`whatsnew_0200.api_breaking.deprecate_group_agg_dict`). -See :ref:`_groupby.aggregate.named` for more. +See :ref:`groupby.aggregate.named` for more. .. _whatsnew_0250.enhancements.other: diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 81ba8ab1c574e..b0c91543dabac 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -212,7 +212,7 @@ class TimelikeOps: .. versionadded:: 0.24.0 - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, \ + 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/generic.py b/pandas/core/generic.py index 8ec8227d8a1d3..d85a3a1ddeff0 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10283,8 +10283,8 @@ def _doc_parms(cls): Returns ------- %(name1)s or %(name2)s (if level specified)\ -%(see_also)s -%(examples)s\ +%(see_also)s\ +%(examples)s """ _num_ddof_doc = """ @@ -10427,7 +10427,8 @@ def _doc_parms(cls): Returns ------- -%(name1)s or %(name2)s\n +%(name1)s or %(name2)s + See Also -------- core.window.Expanding.%(accum_func_name)s : Similar functionality @@ -10788,10 +10789,10 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_shared_docs['stat_func_example'] = """\ +_shared_docs['stat_func_example'] = """ + Examples -------- - >>> idx = pd.MultiIndex.from_arrays([ ... ['warm', 'warm', 'cold', 'cold'], ... ['dog', 'falcon', 'fish', 'spider']], @@ -10820,8 +10821,7 @@ def _doc_parms(cls): blooded warm {level_output_0} cold {level_output_1} -Name: legs, dtype: int64 -""" +Name: legs, dtype: int64""" _sum_examples = _shared_docs['stat_func_example'].format( stat_func='sum', @@ -10831,6 +10831,7 @@ def _doc_parms(cls): level_output_1=8) _sum_examples += """ + By default, the sum of an empty or all-NA Series is ``0``. >>> pd.Series([]).sum() # min_count=0 is the default @@ -10849,8 +10850,7 @@ def _doc_parms(cls): 0.0 >>> pd.Series([np.nan]).sum(min_count=1) -nan -""" +nan""" _max_examples = _shared_docs['stat_func_example'].format( stat_func='max', @@ -10879,10 +10879,10 @@ def _doc_parms(cls): DataFrame.min : Return the minimum over the requested axis. DataFrame.max : Return the maximum over the requested axis. DataFrame.idxmin : Return the index of the minimum over the requested axis. -DataFrame.idxmax : Return the index of the maximum over the requested axis. -""" +DataFrame.idxmax : Return the index of the maximum over the requested axis.""" + +_prod_examples = """ -_prod_examples = """\ Examples -------- By default, the product of an empty or all-NA Series is ``1`` @@ -10902,8 +10902,7 @@ def _doc_parms(cls): 1.0 >>> pd.Series([np.nan]).prod(min_count=1) -nan -""" +nan""" _min_count_stub = """\ min_count : int, default 0