Skip to content

Commit 11640e9

Browse files
author
dedlYTiTAN
committed
DOC: define typing aliases as Sphinx objects in aliases.rst
1 parent 89bf2e7 commit 11640e9

File tree

1 file changed

+279
-70
lines changed

1 file changed

+279
-70
lines changed

doc/source/reference/aliases.rst

Lines changed: 279 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pandas typing aliases
1010
Typing aliases
1111
**************
1212

13-
.. currentmodule:: pandas.api.typing.aliases
13+
.. module:: pandas.api.typing.aliases
1414

1515
The typing declarations in ``pandas/_typing.py`` are considered private, and used
1616
by pandas developers for type checking of the pandas code base. For users, it is
@@ -25,72 +25,281 @@ own python code that calls pandas or expects certain results.
2525

2626
Each of these aliases listed in the table below can be found by importing them from :py:mod:`pandas.api.typing.aliases`.
2727

28-
==================================== ================================================================
29-
Alias Meaning
30-
==================================== ================================================================
31-
:py:type:`AggFuncType` Type of functions that can be passed to :meth:`agg` methods
32-
:py:type:`AlignJoin` Argument type for ``join`` in :meth:`DataFrame.join`
33-
:py:type:`AnyAll` Argument type for ``how`` in :meth:`dropna`
34-
:py:type:`AnyArrayLike` Used to represent :class:`ExtensionArray`, ``numpy`` arrays, :class:`Index` and :class:`Series`
35-
:py:type:`ArrayLike` Used to represent :class:`ExtensionArray`, ``numpy`` arrays
36-
:py:type:`AstypeArg` Argument type in :meth:`astype`
37-
:py:type:`Axes` :py:type:`AnyArrayLike` plus sequences (not strings) and ``range``
38-
:py:type:`Axis` Argument type for ``axis`` in many methods
39-
:py:type:`CSVEngine` Argument type for ``engine`` in :meth:`DataFrame.read_csv`
40-
:py:type:`ColspaceArgType` Argument type for ``colspace`` in :meth:`DataFrame.to_html`
41-
:py:type:`CompressionOptions` Argument type for ``compression`` in all I/O output methods except :meth:`DataFrame.to_parquet`
42-
:py:type:`CorrelationMethod` Argument type for ``correlation`` in :meth:`corr`
43-
:py:type:`DropKeep` Argument type for ``keep`` in :meth:`drop_duplicates`
44-
:py:type:`Dtype` Types as objects that can be used to specify dtypes
45-
:py:type:`DtypeArg` Argument type for ``dtype`` in various methods
46-
:py:type:`DtypeBackend` Argument type for ``dtype_backend`` in various methods
47-
:py:type:`DtypeObj` Numpy dtypes and Extension dtypes
48-
:py:type:`ExcelWriterIfSheetExists` Argument type for ``if_sheet_exists`` in :class:`ExcelWriter`
49-
:py:type:`ExcelWriterMergeCells` Argument type for ``merge_cells`` in :meth:`to_excel`
50-
:py:type:`FilePath` Type of paths for files for I/O methods
51-
:py:type:`FillnaOptions` Argument type for ``method`` in various methods where NA values are filled
52-
:py:type:`FloatFormatType` Argument type for ``float_format`` in :meth:`to_string`
53-
:py:type:`FormattersType` Argument type for ``formatters`` in :meth:`to_string`
54-
:py:type:`FromDictOrient` Argument type for ``orient`` in :meth:`DataFrame.from_dict`
55-
:py:type:`HTMLFlavors` Argument type for ``flavor`` in :meth:`pandas.read_html`
56-
:py:type:`IgnoreRaise` Argument type for ``errors`` in multiple methods
57-
:py:type:`IndexLabel` Argument type for ``level`` in multiple methods
58-
:py:type:`InterpolateOptions` Argument type for ``interpolate`` in :meth:`interpolate`
59-
:py:type:`JSONEngine` Argument type for ``engine`` in :meth:`read_json`
60-
:py:type:`JSONSerializable` Argument type for the return type of a callable for argument ``default_handler`` in :meth:`to_json`
61-
:py:type:`JoinHow` Argument type for ``how`` in :meth:`pandas.merge_ordered` and for ``join`` in :meth:`Series.align`
62-
:py:type:`JoinValidate` Argument type for ``validate`` in :meth:`DataFrame.join`
63-
:py:type:`MergeHow` Argument type for ``how`` in :meth:`merge`
64-
:py:type:`MergeValidate` Argument type for ``validate`` in :meth:`merge`
65-
:py:type:`NaPosition` Argument type for ``na_position`` in :meth:`sort_index` and :meth:`sort_values`
66-
:py:type:`NsmallestNlargestKeep` Argument type for ``keep`` in :meth:`nlargest` and :meth:`nsmallest`
67-
:py:type:`OpenFileErrors` Argument type for ``errors`` in :meth:`to_hdf` and :meth:`to_csv`
68-
:py:type:`Ordered` Return type for :py:attr:`ordered` in :class:`CategoricalDtype` and :class:`Categorical`
69-
:py:type:`ParquetCompressionOptions` Argument type for ``compression`` in :meth:`DataFrame.to_parquet`
70-
:py:type:`QuantileInterpolation` Argument type for ``interpolation`` in :meth:`quantile`
71-
:py:type:`ReadBuffer` Additional argument type corresponding to buffers for various file reading methods
72-
:py:type:`ReadCsvBuffer` Additional argument type corresponding to buffers for :meth:`pandas.read_csv`
73-
:py:type:`ReadPickleBuffer` Additional argument type corresponding to buffers for :meth:`pandas.read_pickle`
74-
:py:type:`ReindexMethod` Argument type for ``reindex`` in :meth:`reindex`
75-
:py:type:`Scalar` Types that can be stored in :class:`Series` with non-object dtype
76-
:py:type:`SequenceNotStr` Used for arguments that require sequences, but not plain strings
77-
:py:type:`SliceType` Argument types for ``start`` and ``end`` in :meth:`Index.slice_locs`
78-
:py:type:`SortKind` Argument type for ``kind`` in :meth:`sort_index` and :meth:`sort_values`
79-
:py:type:`StorageOptions` Argument type for ``storage_options`` in various file output methods
80-
:py:type:`Suffixes` Argument type for ``suffixes`` in :meth:`merge`, :meth:`compare` and :meth:`merge_ordered`
81-
:py:type:`TakeIndexer` Argument type for ``indexer`` and ``indices`` in :meth:`take`
82-
:py:type:`TimeAmbiguous` Argument type for ``ambiguous`` in time operations
83-
:py:type:`TimeGrouperOrigin` Argument type for ``origin`` in :meth:`resample` and :class:`TimeGrouper`
84-
:py:type:`TimeNonexistent` Argument type for ``nonexistent`` in time operations
85-
:py:type:`TimeUnit` Time unit argument and return type for :py:attr:`unit`, arguments ``unit`` and ``date_unit``
86-
:py:type:`TimedeltaConvertibleTypes` Argument type for ``offset`` in :meth:`resample`, ``halflife`` in :meth:`ewm` and ``start`` and ``end`` in :meth:`pandas.timedelta_range`
87-
:py:type:`TimestampConvertibleTypes` Argument type for ``origin`` in :meth:`resample` and :meth:`pandas.to_datetime`
88-
:py:type:`ToStataByteorder` Argument type for ``byteorder`` in :meth:`DataFrame.to_stata`
89-
:py:type:`ToTimestampHow` Argument type for ``how`` in :meth:`to_timestamp` and ``convention`` in :meth:`resample`
90-
:py:type:`UpdateJoin` Argument type for ``join`` in :meth:`DataFrame.update`
91-
:py:type:`UsecolsArgType` Argument type for ``usecols`` in :meth:`pandas.read_clipboard`, :meth:`pandas.read_csv` and :meth:`pandas.read_excel`
92-
:py:type:`WindowingRankType` Argument type for ``method`` in :meth:`rank` in rolling and expanding window operations
93-
:py:type:`WriteBuffer` Additional argument type corresponding to buffers for various file output methods
94-
:py:type:`WriteExcelBuffer` Additional argument type corresponding to buffers for :meth:`to_excel`
95-
:py:type:`XMLParsers` Argument type for ``parser`` in :meth:`DataFrame.to_xml` and :meth:`pandas.read_xml`
96-
==================================== ================================================================
28+
.. type:: AggFuncType
29+
30+
Type of functions that can be passed to :meth:`agg` methods.
31+
32+
.. type:: AlignJoin
33+
34+
Argument type for ``join`` in :meth:`DataFrame.join`.
35+
36+
.. type:: AnyAll
37+
38+
Argument type for ``how`` in :meth:`dropna`.
39+
40+
.. type:: AnyArrayLike
41+
42+
Used to represent :class:`ExtensionArray`, ``numpy`` arrays, :class:`Index` and
43+
:class:`Series`.
44+
45+
.. type:: ArrayLike
46+
47+
Used to represent :class:`ExtensionArray`, ``numpy`` arrays.
48+
49+
.. type:: AstypeArg
50+
51+
Argument type in :meth:`astype`.
52+
53+
.. type:: Axes
54+
55+
:py:type:`AnyArrayLike` plus sequences (not strings) and ``range``.
56+
57+
.. type:: Axis
58+
59+
Argument type for ``axis`` in many methods.
60+
61+
.. type:: CSVEngine
62+
63+
Argument type for ``engine`` in :meth:`DataFrame.read_csv`.
64+
65+
.. type:: ColspaceArgType
66+
67+
Argument type for ``colspace`` in :meth:`DataFrame.to_html`.
68+
69+
.. type:: CompressionOptions
70+
71+
Argument type for ``compression`` in all I/O output methods except
72+
:meth:`DataFrame.to_parquet`.
73+
74+
.. type:: CorrelationMethod
75+
76+
Argument type for ``correlation`` in :meth:`corr`.
77+
78+
.. type:: DropKeep
79+
80+
Argument type for ``keep`` in :meth:`drop_duplicates`.
81+
82+
.. type:: Dtype
83+
84+
Types as objects that can be used to specify dtypes.
85+
86+
.. type:: DtypeArg
87+
88+
Argument type for ``dtype`` in various methods.
89+
90+
.. type:: DtypeBackend
91+
92+
Argument type for ``dtype_backend`` in various methods.
93+
94+
.. type:: DtypeObj
95+
96+
Numpy dtypes and Extension dtypes.
97+
98+
.. type:: ExcelWriterIfSheetExists
99+
100+
Argument type for ``if_sheet_exists`` in :class:`ExcelWriter`.
101+
102+
.. type:: ExcelWriterMergeCells
103+
104+
Argument type for ``merge_cells`` in :meth:`to_excel`.
105+
106+
.. type:: FilePath
107+
108+
Type of paths for files for I/O methods.
109+
110+
.. type:: FillnaOptions
111+
112+
Argument type for ``method`` in various methods where NA values are filled.
113+
114+
.. type:: FloatFormatType
115+
116+
Argument type for ``float_format`` in :meth:`to_string`.
117+
118+
.. type:: FormattersType
119+
120+
Argument type for ``formatters`` in :meth:`to_string`.
121+
122+
.. type:: FromDictOrient
123+
124+
Argument type for ``orient`` in :meth:`DataFrame.from_dict`.
125+
126+
.. type:: HTMLFlavors
127+
128+
Argument type for ``flavor`` in :meth:`pandas.read_html`.
129+
130+
.. type:: IgnoreRaise
131+
132+
Argument type for ``errors`` in multiple methods.
133+
134+
.. type:: IndexLabel
135+
136+
Argument type for ``level`` in multiple methods.
137+
138+
.. type:: InterpolateOptions
139+
140+
Argument type for ``interpolate`` in :meth:`interpolate`.
141+
142+
.. type:: JSONEngine
143+
144+
Argument type for ``engine`` in :meth:`read_json`.
145+
146+
.. type:: JSONSerializable
147+
148+
Argument type for the return type of a callable for argument
149+
``default_handler`` in :meth:`to_json`.
150+
151+
.. type:: JoinHow
152+
153+
Argument type for ``how`` in :meth:`pandas.merge_ordered` and for ``join`` in
154+
:meth:`Series.align`.
155+
156+
.. type:: JoinValidate
157+
158+
Argument type for ``validate`` in :meth:`DataFrame.join`.
159+
160+
.. type:: MergeHow
161+
162+
Argument type for ``how`` in :meth:`merge`.
163+
164+
.. type:: MergeValidate
165+
166+
Argument type for ``validate`` in :meth:`merge`.
167+
168+
.. type:: NaPosition
169+
170+
Argument type for ``na_position`` in :meth:`sort_index` and
171+
:meth:`sort_values`.
172+
173+
.. type:: NsmallestNlargestKeep
174+
175+
Argument type for ``keep`` in :meth:`nlargest` and :meth:`nsmallest`.
176+
177+
.. type:: OpenFileErrors
178+
179+
Argument type for ``errors`` in :meth:`to_hdf` and :meth:`to_csv`.
180+
181+
.. type:: Ordered
182+
183+
Return type for :py:attr:`ordered` in :class:`CategoricalDtype` and
184+
:class:`Categorical`.
185+
186+
.. type:: ParquetCompressionOptions
187+
188+
Argument type for ``compression`` in :meth:`DataFrame.to_parquet`.
189+
190+
.. type:: QuantileInterpolation
191+
192+
Argument type for ``interpolation`` in :meth:`quantile`.
193+
194+
.. type:: ReadBuffer
195+
196+
Additional argument type corresponding to buffers for various file reading
197+
methods.
198+
199+
.. type:: ReadCsvBuffer
200+
201+
Additional argument type corresponding to buffers for
202+
:meth:`pandas.read_csv`.
203+
204+
.. type:: ReadPickleBuffer
205+
206+
Additional argument type corresponding to buffers for
207+
:meth:`pandas.read_pickle`.
208+
209+
.. type:: ReindexMethod
210+
211+
Argument type for ``reindex`` in :meth:`reindex`.
212+
213+
.. type:: Scalar
214+
215+
Types that can be stored in :class:`Series` with non-object dtype.
216+
217+
.. type:: SequenceNotStr
218+
219+
Used for arguments that require sequences, but not plain strings.
220+
221+
.. type:: SliceType
222+
223+
Argument types for ``start`` and ``end`` in :meth:`Index.slice_locs`.
224+
225+
.. type:: SortKind
226+
227+
Argument type for ``kind`` in :meth:`sort_index` and :meth:`sort_values`.
228+
229+
.. type:: StorageOptions
230+
231+
Argument type for ``storage_options`` in various file output methods.
232+
233+
.. type:: Suffixes
234+
235+
Argument type for ``suffixes`` in :meth:`merge`, :meth:`compare` and
236+
:meth:`merge_ordered`.
237+
238+
.. type:: TakeIndexer
239+
240+
Argument type for ``indexer`` and ``indices`` in :meth:`take`.
241+
242+
.. type:: TimeAmbiguous
243+
244+
Argument type for ``ambiguous`` in time operations.
245+
246+
.. type:: TimeGrouperOrigin
247+
248+
Argument type for ``origin`` in :meth:`resample` and :class:`TimeGrouper`.
249+
250+
.. type:: TimeNonexistent
251+
252+
Argument type for ``nonexistent`` in time operations.
253+
254+
.. type:: TimeUnit
255+
256+
Time unit argument and return type for :py:attr:`unit`, arguments ``unit`` and
257+
``date_unit``.
258+
259+
.. type:: TimedeltaConvertibleTypes
260+
261+
Argument type for ``offset`` in :meth:`resample`, ``halflife`` in
262+
:meth:`ewm` and ``start`` and ``end`` in
263+
:meth:`pandas.timedelta_range`.
264+
265+
.. type:: TimestampConvertibleTypes
266+
267+
Argument type for ``origin`` in :meth:`resample` and
268+
:meth:`pandas.to_datetime`.
269+
270+
.. type:: ToStataByteorder
271+
272+
Argument type for ``byteorder`` in :meth:`DataFrame.to_stata`.
273+
274+
.. type:: ToTimestampHow
275+
276+
Argument type for ``how`` in :meth:`to_timestamp` and ``convention`` in
277+
:meth:`resample`.
278+
279+
.. type:: UpdateJoin
280+
281+
Argument type for ``join`` in :meth:`DataFrame.update`.
282+
283+
.. type:: UsecolsArgType
284+
285+
Argument type for ``usecols`` in :meth:`pandas.read_clipboard`,
286+
:meth:`pandas.read_csv` and :meth:`pandas.read_excel`.
287+
288+
.. type:: WindowingRankType
289+
290+
Argument type for ``method`` in :meth:`rank` in rolling and expanding window
291+
operations.
292+
293+
.. type:: WriteBuffer
294+
295+
Additional argument type corresponding to buffers for various file output
296+
methods.
297+
298+
.. type:: WriteExcelBuffer
299+
300+
Additional argument type corresponding to buffers for :meth:`to_excel`.
301+
302+
.. type:: XMLParsers
303+
304+
Argument type for ``parser`` in :meth:`DataFrame.to_xml` and
305+
:meth:`pandas.read_xml`.

0 commit comments

Comments
 (0)