Skip to main content
`Ctrl`+`K`

# pandas.api.types.pandas_dtype

pandas.api.types.pandas_dtype(dtype)

  Convert input into a pandas only dtype object or a numpy dtype object.

  This function first checks for pandas extension types registered in the dtype registry, then falls back to NumPy dtype resolution. It accepts strings, types, numpy dtypes, and pandas ExtensionDtype instances.

  Parameters:
    dtype object

      The object to be converted into a dtype.

  Returns:
    np.dtype or a pandas dtype

      The converted dtype, which can be either a numpy dtype or a pandas dtype.

  Raises:
    TypeError if not a dtype

  See also

  `api.types.is_dtype`

    Return true if the condition is satisfied for the arr_or_dtype.

  Examples

      >>> pd.api.types.pandas_dtype(int)
      dtype('int64')