Skip to content

Commit 4acc937

Browse files
authored
DOC: Move general utility functions to better locations (#46177)
1 parent 38145a3 commit 4acc937

File tree

9 files changed

+176
-153
lines changed

9 files changed

+176
-153
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ repos:
178178
language: python
179179
files: ^pandas/core/generic\.py$
180180
- id: pandas-errors-documented
181-
name: Ensure pandas errors are documented in doc/source/reference/general_utility_functions.rst
181+
name: Ensure pandas errors are documented in doc/source/reference/testing.rst
182182
entry: python scripts/pandas_errors_documented.py
183183
language: python
184184
files: ^pandas/errors/__init__.py$

doc/source/reference/arrays.rst

+89-16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
pandas arrays, scalars, and data types
77
======================================
88

9+
*******
10+
Objects
11+
*******
12+
913
.. currentmodule:: pandas
1014

1115
For most data types, pandas uses NumPy arrays as the concrete
@@ -40,8 +44,8 @@ stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFra
4044

4145
.. _api.arrays.datetime:
4246

43-
Datetime data
44-
-------------
47+
Datetimes
48+
---------
4549

4650
NumPy cannot natively represent timezone-aware datetimes. pandas supports this
4751
with the :class:`arrays.DatetimeArray` extension array, which can hold timezone-naive
@@ -161,8 +165,8 @@ If the data are timezone-aware, then every value in the array must have the same
161165

162166
.. _api.arrays.timedelta:
163167

164-
Timedelta data
165-
--------------
168+
Timedeltas
169+
----------
166170

167171
NumPy can natively represent timedeltas. pandas provides :class:`Timedelta`
168172
for symmetry with :class:`Timestamp`.
@@ -216,8 +220,8 @@ A collection of :class:`Timedelta` may be stored in a :class:`TimedeltaArray`.
216220

217221
.. _api.arrays.period:
218222

219-
Timespan data
220-
-------------
223+
Periods
224+
-------
221225

222226
pandas represents spans of times as :class:`Period` objects.
223227

@@ -284,8 +288,8 @@ Every period in a :class:`arrays.PeriodArray` must have the same ``freq``.
284288

285289
.. _api.arrays.interval:
286290

287-
Interval data
288-
-------------
291+
Intervals
292+
---------
289293

290294
Arbitrary intervals can be represented as :class:`Interval` objects.
291295

@@ -379,8 +383,8 @@ pandas provides this through :class:`arrays.IntegerArray`.
379383

380384
.. _api.arrays.categorical:
381385

382-
Categorical data
383-
----------------
386+
Categoricals
387+
------------
384388

385389
pandas defines a custom data type for representing data that can take only a
386390
limited, fixed set of values. The dtype of a :class:`Categorical` can be described by
@@ -444,8 +448,8 @@ data. See :ref:`api.series.cat` for more.
444448

445449
.. _api.arrays.sparse:
446450

447-
Sparse data
448-
-----------
451+
Sparse
452+
------
449453

450454
Data where a single value is repeated many times (e.g. ``0`` or ``NaN``) may
451455
be stored efficiently as a :class:`arrays.SparseArray`.
@@ -469,8 +473,8 @@ and methods if the :class:`Series` contains sparse values. See
469473

470474
.. _api.arrays.string:
471475

472-
Text data
473-
---------
476+
Strings
477+
-------
474478

475479
When working with text data, where each valid element is a string or missing,
476480
we recommend using :class:`StringDtype` (with the alias ``"string"``).
@@ -494,8 +498,8 @@ See :ref:`api.series.str` for more.
494498

495499
.. _api.arrays.bool:
496500

497-
Boolean data with missing values
498-
--------------------------------
501+
Nullable Boolean
502+
----------------
499503

500504
The boolean dtype (with the alias ``"boolean"``) provides support for storing
501505
boolean data (``True``, ``False``) with missing values, which is not possible
@@ -525,3 +529,72 @@ with a bool :class:`numpy.ndarray`.
525529
DatetimeTZDtype.tz
526530
PeriodDtype.freq
527531
IntervalDtype.subtype
532+
533+
*********
534+
Utilities
535+
*********
536+
537+
Constructors
538+
------------
539+
.. autosummary::
540+
:toctree: api/
541+
542+
api.types.union_categoricals
543+
api.types.infer_dtype
544+
api.types.pandas_dtype
545+
546+
Data type introspection
547+
~~~~~~~~~~~~~~~~~~~~~~~
548+
.. autosummary::
549+
:toctree: api/
550+
551+
api.types.is_bool_dtype
552+
api.types.is_categorical_dtype
553+
api.types.is_complex_dtype
554+
api.types.is_datetime64_any_dtype
555+
api.types.is_datetime64_dtype
556+
api.types.is_datetime64_ns_dtype
557+
api.types.is_datetime64tz_dtype
558+
api.types.is_extension_type
559+
api.types.is_extension_array_dtype
560+
api.types.is_float_dtype
561+
api.types.is_int64_dtype
562+
api.types.is_integer_dtype
563+
api.types.is_interval_dtype
564+
api.types.is_numeric_dtype
565+
api.types.is_object_dtype
566+
api.types.is_period_dtype
567+
api.types.is_signed_integer_dtype
568+
api.types.is_string_dtype
569+
api.types.is_timedelta64_dtype
570+
api.types.is_timedelta64_ns_dtype
571+
api.types.is_unsigned_integer_dtype
572+
api.types.is_sparse
573+
574+
Iterable introspection
575+
~~~~~~~~~~~~~~~~~~~~~~
576+
.. autosummary::
577+
:toctree: api/
578+
579+
api.types.is_dict_like
580+
api.types.is_file_like
581+
api.types.is_list_like
582+
api.types.is_named_tuple
583+
api.types.is_iterator
584+
585+
Scalar introspection
586+
~~~~~~~~~~~~~~~~~~~~
587+
.. autosummary::
588+
:toctree: api/
589+
590+
api.types.is_bool
591+
api.types.is_categorical
592+
api.types.is_complex
593+
api.types.is_float
594+
api.types.is_hashable
595+
api.types.is_integer
596+
api.types.is_interval
597+
api.types.is_number
598+
api.types.is_re
599+
api.types.is_re_compilable
600+
api.types.is_scalar

doc/source/reference/general_functions.rst

-7
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,3 @@ Hashing
7878

7979
util.hash_array
8080
util.hash_pandas_object
81-
82-
Testing
83-
~~~~~~~
84-
.. autosummary::
85-
:toctree: api/
86-
87-
test

doc/source/reference/general_utility_functions.rst

-127
This file was deleted.

doc/source/reference/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public functions related to data types in pandas.
3737
resampling
3838
style
3939
plotting
40-
general_utility_functions
40+
options
4141
extensions
42+
testing
4243

4344
.. This is to prevent warnings in the doc build. We don't want to encourage
4445
.. these methods.

doc/source/reference/options.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{ header }}
2+
3+
.. _api.options:
4+
5+
====================
6+
Options and settings
7+
====================
8+
.. currentmodule:: pandas
9+
10+
API for configuring global behavior. See :ref:`the User Guide <options>` for more.
11+
12+
Working with options
13+
--------------------
14+
.. autosummary::
15+
:toctree: api/
16+
17+
describe_option
18+
reset_option
19+
get_option
20+
set_option
21+
option_context

0 commit comments

Comments
 (0)