Skip to content

DOC: improve IO & General Functions API reference #45208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/source/reference/general_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand All @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -5433,7 +5433,7 @@ def pipe(
**kwargs,
) -> T:
r"""
Apply func(self, \*args, \*\*kwargs).
Apply chainable functions that expect Series or DataFrames.
Parameters
----------
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions pandas/util/_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@


def test(extra_args=None):
"""
Run the pandas test suite using pytest.
"""
try:
import pytest
except ImportError as err:
Expand Down