pandas.api.types.is_complex_dtype#
- pandas.api.types.is_complex_dtype(arr_or_dtype)[源代码]#
检查提供的数组或数据类型是否为复杂数据类型。
- 参数
- arr_or_dtype类似数组或数据类型
要检查的数组或数据类型。
- 退货
- 布尔值
数组或数据类型是否为复数数据类型。
示例
>>> is_complex_dtype(str) False >>> is_complex_dtype(int) False >>> is_complex_dtype(np.complex_) 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