Skip to content

Commit 45b8212

Browse files
committed
Doc: add parameter description, import of example and see also section for api.types.is_dtype
1 parent caa4e9c commit 45b8212

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

pandas/core/dtypes/common.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,24 +655,38 @@ def is_dtype_equal(source, target) -> bool:
655655
656656
Parameters
657657
----------
658-
source : The first dtype to compare
659-
target : The second dtype to compare
658+
source : dtype
659+
The first dtype to compare
660+
target : dtype
661+
The second dtype to compare
660662
661663
Returns
662664
-------
663665
boolean
664666
Whether or not the two dtypes are equal.
665667
668+
See Also
669+
--------
670+
pandas.api.types.is_categorical_dtype : Check whether the provided array or dtype
671+
is of the Categorical dtype.
672+
pandas.api.types.is_string_dtype : Check whether the provided array or dtype
673+
is of the string dtype.
674+
pandas.api.types.is_object_dtype : Check whether an array-like or dtype is of the
675+
object dtype.
676+
666677
Examples
667678
--------
679+
>>> from pandas.api.types import is_dtype_equal
668680
>>> is_dtype_equal(int, float)
669681
False
670682
>>> is_dtype_equal("int", int)
671683
True
672684
>>> is_dtype_equal(object, "category")
673685
False
686+
>>> from pandas.core.dtypes.dtypes import CategoricalDtype
674687
>>> is_dtype_equal(CategoricalDtype(), "category")
675688
True
689+
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
676690
>>> is_dtype_equal(DatetimeTZDtype(tz="UTC"), "datetime64")
677691
False
678692
"""

0 commit comments

Comments
 (0)