pandas.StringDtype#

class pandas.StringDtype(storage=None, na_value=<NA>)[source]#

Extension dtype for string data.

The data is stored as Python str objects or in a PyArrow array, depending on storage. See Working with text data for details.

Parameters:
storage{“python”, “pyarrow”}, optional

If not given, the value of pd.options.mode.string_storage.

na_value{np.nan, pd.NA}, default pd.NA

Whether the dtype follows NaN or NA missing value semantics.

Attributes

storage

The storage backend for this dtype.

na_value

The missing value representation for this dtype.

See also

BooleanDtype

Extension dtype for boolean data.

Examples

>>> pd.StringDtype()
<StringDtype(na_value=<NA>)>
>>> pd.StringDtype(storage="python")
<StringDtype(storage='python', na_value=<NA>)>