pandas.api.types.is_string_dtype
- pandas.api.types.is_string_dtype(arr_or_dtype)[source]
-
Check whether the provided array or dtype is of the string dtype.
- Parameters
-
- arr_or_dtype:array-like
-
The array or dtype to check.
- Returns
-
- boolean
-
Whether or not the array or dtype is of the string dtype.
Examples
>>> is_string_dtype(str) True >>> is_string_dtype(object) True >>> is_string_dtype(int) False >>> >>> is_string_dtype(np.array(['a', 'b'])) True >>> is_string_dtype(pd.Series([1, 2])) False
© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.api.types.is_string_dtype.html