W3cubDocs

/pandas 2

pandas.api.types.pandas_dtype

pandas.api.types.pandas_dtype(dtype)[source]

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

Parameters:
dtype:object to be converted
Returns:
np.dtype or a pandas dtype
Raises:
TypeError if not a dtype

Examples

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

© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.api.types.pandas_dtype.html