diff --git a/doc/source/reference/general_functions.rst b/doc/source/reference/general_functions.rst index b5832cb8aa591..dde16fb7fac71 100644 --- a/doc/source/reference/general_functions.rst +++ b/doc/source/reference/general_functions.rst @@ -37,15 +37,15 @@ Top-level missing data notna notnull -Top-level conversions -~~~~~~~~~~~~~~~~~~~~~ +Top-level dealing with numeric data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ to_numeric -Top-level dealing with datetimelike -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Top-level dealing with datetimelike data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -57,8 +57,8 @@ Top-level dealing with datetimelike timedelta_range infer_freq -Top-level dealing with intervals -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Top-level dealing with Interval data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/io.rst b/doc/source/reference/io.rst index 7aad937d10a18..44ee09f2a5e6b 100644 --- a/doc/source/reference/io.rst +++ b/doc/source/reference/io.rst @@ -135,7 +135,7 @@ HDFStore: PyTables (HDF5) .. warning:: - One can store a subclass of ``DataFrame`` or ``Series`` to HDF5, + One can store a subclass of :class:`DataFrame` or :class:`Series` to HDF5, but the type of the subclass is lost upon storing. Feather diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 320207d1a26d5..1fa1878f11a26 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -335,8 +335,9 @@ def _check_object_for_strings(values: np.ndarray) -> str: def unique(values): """ - Hash table-based unique. Uniques are returned in order - of appearance. This does NOT sort. + Return unique values based on a hash table. + + Uniques are returned in order of appearance. This does NOT sort. Significantly faster than numpy.unique for long enough sequences. Includes NA values. diff --git a/pandas/core/base.py b/pandas/core/base.py index ef3a60f46283a..504b6d507a87e 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -763,7 +763,9 @@ def __iter__(self): @cache_readonly def hasnans(self) -> bool: """ - Return if I have any nans; enables various perf speedups. + Return True if there are any NaNs. + + Enables various performance speedups. """ return bool(isna(self).any()) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b92272d72b399..193be98e904b9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3182,7 +3182,7 @@ def to_latex( position=None, ): r""" - Render object to a LaTeX tabular, longtable, or nested table/tabular. + Render object to a LaTeX tabular, longtable, or nested table. Requires ``\usepackage{{booktabs}}``. The output can be copy/pasted into a main LaTeX document or read from an external file @@ -5433,7 +5433,7 @@ def pipe( **kwargs, ) -> T: r""" - Apply func(self, \*args, \*\*kwargs). + Apply chainable functions that expect Series or DataFrames. Parameters ---------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 6c7499a575fca..1b1ad4bb64987 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2646,7 +2646,9 @@ def _isnan(self) -> npt.NDArray[np.bool_]: @cache_readonly def hasnans(self) -> bool: """ - Return if I have any nans; enables various perf speedups. + Return True if there are any NaNs. + + Enables various performance speedups. """ if self._can_hold_na: return bool(self._isnan.any()) diff --git a/pandas/core/reshape/melt.py b/pandas/core/reshape/melt.py index 7026e470df1c0..9cff7461becdb 100644 --- a/pandas/core/reshape/melt.py +++ b/pandas/core/reshape/melt.py @@ -257,7 +257,9 @@ def wide_to_long( df: DataFrame, stubnames, i, j, sep: str = "", suffix: str = r"\d+" ) -> DataFrame: r""" - Wide panel to long format. Less flexible but more user-friendly than melt. + Unpivot a DataFrame from wide to long format. + + Less flexible but more user-friendly than melt. With stubnames ['A', 'B'], this function expects to find one or more group of columns with format diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 412cc5a8b43a3..3a39713f18d65 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -195,7 +195,7 @@ def merge_ordered( how: str = "outer", ) -> DataFrame: """ - Perform merge with optional filling/interpolation. + Perform a merge for ordered data with optional filling/interpolation. Designed for ordered data like time series data. Optionally perform group-wise merge (see examples). @@ -340,7 +340,7 @@ def merge_asof( direction: str = "backward", ) -> DataFrame: """ - Perform an asof merge. + Perform a merge by key distance. This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the key. diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 451ab170e149d..b11d74836b68e 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -2605,6 +2605,9 @@ def _encode_strings(self) -> None: self.data[col] = encoded def write_file(self) -> None: + """ + Export DataFrame object to Stata dta format. + """ with get_handle( self._fname, "wb", diff --git a/pandas/util/_tester.py b/pandas/util/_tester.py index 541776619a2d3..6725a84aee962 100644 --- a/pandas/util/_tester.py +++ b/pandas/util/_tester.py @@ -8,6 +8,9 @@ def test(extra_args=None): + """ + Run the pandas test suite using pytest. + """ try: import pytest except ImportError as err: