Skip to main content
`Ctrl`+`K`

# pandas.api.types.is_complex_dtype

pandas.api.types.is_complex_dtype(arr_or_dtype)

  Check whether the provided array or dtype is of a complex dtype.

  Complex dtypes represent numbers with both real and imaginary parts, such as `np.complex64` and `np.complex128`.

  Parameters:
    arr_or_dtype array-like or dtype

      The array or dtype to check.

  Returns:
    boolean

      Whether or not the array or dtype is of a complex dtype.

  See also

  `api.types.is_complex`

    Return True if given object is complex.

  `api.types.is_numeric_dtype`

    Check whether the provided array or dtype is of a numeric dtype.

  `api.types.is_integer_dtype`

    Check whether the provided array or dtype is of an integer dtype.

  Examples

      >>> from pandas.api.types import is_complex_dtype
      >>> is_complex_dtype(str)
      False
      >>> is_complex_dtype(int)
      False
      >>> is_complex_dtype(np.complex128)
      True
      >>> is_complex_dtype(np.array(["a", "b"]))
      False
      >>> is_complex_dtype(pd.Series([1, 2]))
      False
      >>> is_complex_dtype(np.array([1 + 1j, 5]))
      True