File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -664,6 +664,7 @@ Data type introspection
664
664
api.types.is_datetime64_dtype
665
665
api.types.is_datetime64_ns_dtype
666
666
api.types.is_datetime64tz_dtype
667
+ api.types.is_dtype_equal
667
668
api.types.is_extension_array_dtype
668
669
api.types.is_float_dtype
669
670
api.types.is_int64_dtype
Original file line number Diff line number Diff line change @@ -655,24 +655,38 @@ def is_dtype_equal(source, target) -> bool:
655
655
656
656
Parameters
657
657
----------
658
- source : The first dtype to compare
659
- target : The second dtype to compare
658
+ source : type or str
659
+ The first dtype to compare.
660
+ target : type or str
661
+ The second dtype to compare.
660
662
661
663
Returns
662
664
-------
663
665
boolean
664
666
Whether or not the two dtypes are equal.
665
667
668
+ See Also
669
+ --------
670
+ api.types.is_categorical_dtype : Check whether the provided array or dtype
671
+ is of the Categorical dtype.
672
+ api.types.is_string_dtype : Check whether the provided array or dtype
673
+ is of the string dtype.
674
+ api.types.is_object_dtype : Check whether an array-like or dtype is of the
675
+ object dtype.
676
+
666
677
Examples
667
678
--------
679
+ >>> from pandas.api.types import is_dtype_equal
668
680
>>> is_dtype_equal(int, float)
669
681
False
670
682
>>> is_dtype_equal("int", int)
671
683
True
672
684
>>> is_dtype_equal(object, "category")
673
685
False
686
+ >>> from pandas.core.dtypes.dtypes import CategoricalDtype
674
687
>>> is_dtype_equal(CategoricalDtype(), "category")
675
688
True
689
+ >>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
676
690
>>> is_dtype_equal(DatetimeTZDtype(tz="UTC"), "datetime64")
677
691
False
678
692
"""
You can’t perform that action at this time.
0 commit comments