Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

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.

If an array is passed with an object dtype, the elements must beinferred as strings.

Parameters:
arr_or_dtypearray-like or dtype

The array or dtype to check.

Returns:
boolean

Whether or not the array or dtype is of the string dtype.

Examples

>>>frompandas.api.typesimportis_string_dtype>>>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>>>is_string_dtype(pd.Series([1,2],dtype=object))False

[8]ページ先頭

©2009-2025 Movatter.jp