File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed 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 : dtype
659
+ The first dtype to compare
660
+ target : dtype
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
+ 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
+
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