Skip to content

Commit 078b732

Browse files
Fix docs for api.types (#59753)
* Fix is_bool * Fix is_categorical_dtype * Fix is_complex * Fix is_complex_dtype * Fix is_datetime64_dtype * Fix is_datetime64_ns_dtype * Fix is_datetime64tz_dtype --------- Co-authored-by: Abhinav Thimma <[email protected]>
1 parent 53cadbb commit 078b732

File tree

3 files changed

+58
-7
lines changed

3 files changed

+58
-7
lines changed

ci/code_checks.sh

-7
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
123123
-i "pandas.Timestamp.tzinfo GL08" \
124124
-i "pandas.Timestamp.year GL08" \
125125
-i "pandas.api.extensions.ExtensionArray.interpolate PR01,SA01" \
126-
-i "pandas.api.types.is_bool PR01,SA01" \
127-
-i "pandas.api.types.is_categorical_dtype SA01" \
128-
-i "pandas.api.types.is_complex PR01,SA01" \
129-
-i "pandas.api.types.is_complex_dtype SA01" \
130-
-i "pandas.api.types.is_datetime64_dtype SA01" \
131-
-i "pandas.api.types.is_datetime64_ns_dtype SA01" \
132-
-i "pandas.api.types.is_datetime64tz_dtype SA01" \
133126
-i "pandas.api.types.is_dict_like PR07,SA01" \
134127
-i "pandas.api.types.is_extension_array_dtype SA01" \
135128
-i "pandas.api.types.is_file_like PR07,SA01" \

pandas/_libs/lib.pyx

+23
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,21 @@ def is_bool(obj: object) -> bool:
11231123
"""
11241124
Return True if given object is boolean.
11251125

1126+
Parameters
1127+
----------
1128+
obj : object
1129+
Object to check.
1130+
11261131
Returns
11271132
-------
11281133
bool
11291134

1135+
See Also
1136+
--------
1137+
api.types.is_scalar : Check if the input is a scalar.
1138+
api.types.is_integer : Check if the input is an integer.
1139+
api.types.is_float : Check if the input is a float.
1140+
11301141
Examples
11311142
--------
11321143
>>> pd.api.types.is_bool(True)
@@ -1142,10 +1153,22 @@ def is_complex(obj: object) -> bool:
11421153
"""
11431154
Return True if given object is complex.
11441155

1156+
Parameters
1157+
----------
1158+
obj : object
1159+
Object to check.
1160+
11451161
Returns
11461162
-------
11471163
bool
11481164

1165+
See Also
1166+
--------
1167+
api.types.is_complex_dtype: Check whether the provided array or
1168+
dtype is of a complex dtype.
1169+
api.types.is_number: Check if the object is a number.
1170+
api.types.is_integer: Return True if given object is integer.
1171+
11491172
Examples
11501173
--------
11511174
>>> pd.api.types.is_complex(1 + 1j)

pandas/core/dtypes/common.py

+35
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ def is_datetime64_dtype(arr_or_dtype) -> bool:
279279
boolean
280280
Whether or not the array-like or dtype is of the datetime64 dtype.
281281
282+
See Also
283+
--------
284+
api.types.is_datetime64_ns_dtype: Check whether the provided array or
285+
dtype is of the datetime64[ns] dtype.
286+
api.types.is_datetime64_any_dtype: Check whether the provided array or
287+
dtype is of the datetime64 dtype.
288+
282289
Examples
283290
--------
284291
>>> from pandas.api.types import is_datetime64_dtype
@@ -316,6 +323,13 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:
316323
boolean
317324
Whether or not the array-like or dtype is of a DatetimeTZDtype dtype.
318325
326+
See Also
327+
--------
328+
api.types.is_datetime64_dtype: Check whether an array-like or
329+
dtype is of the datetime64 dtype.
330+
api.types.is_datetime64_any_dtype: Check whether the provided array or
331+
dtype is of the datetime64 dtype.
332+
319333
Examples
320334
--------
321335
>>> from pandas.api.types import is_datetime64tz_dtype
@@ -514,6 +528,12 @@ def is_categorical_dtype(arr_or_dtype) -> bool:
514528
boolean
515529
Whether or not the array-like or dtype is of the Categorical dtype.
516530
531+
See Also
532+
--------
533+
api.types.is_list_like: Check if the object is list-like.
534+
api.types.is_complex_dtype: Check whether the provided array or
535+
dtype is of a complex dtype.
536+
517537
Examples
518538
--------
519539
>>> from pandas.api.types import is_categorical_dtype
@@ -977,6 +997,13 @@ def is_datetime64_ns_dtype(arr_or_dtype) -> bool:
977997
bool
978998
Whether or not the array or dtype is of the datetime64[ns] dtype.
979999
1000+
See Also
1001+
--------
1002+
api.types.is_datetime64_dtype: Check whether an array-like or
1003+
dtype is of the datetime64 dtype.
1004+
api.types.is_datetime64_any_dtype: Check whether the provided array or
1005+
dtype is of the datetime64 dtype.
1006+
9801007
Examples
9811008
--------
9821009
>>> from pandas.api.types import is_datetime64_ns_dtype
@@ -1436,6 +1463,14 @@ def is_complex_dtype(arr_or_dtype) -> bool:
14361463
boolean
14371464
Whether or not the array or dtype is of a complex dtype.
14381465
1466+
See Also
1467+
--------
1468+
api.types.is_complex: Return True if given object is complex.
1469+
api.types.is_numeric_dtype: Check whether the provided array or
1470+
dtype is of a numeric dtype.
1471+
api.types.is_integer_dtype: Check whether the provided array or
1472+
dtype is of an integer dtype.
1473+
14391474
Examples
14401475
--------
14411476
>>> from pandas.api.types import is_complex_dtype

0 commit comments

Comments
 (0)