pandas.api.extensions.ExtensionArray._from_sequence_of_strings#
- classmethod ExtensionArray._from_sequence_of_strings(strings, *, dtype, copy=False)[source]#
Construct a new ExtensionArray from a sequence of strings.
- Parameters:
- stringsSequence
Each element will be an instance of the scalar type for this array,
cls.dtype.type
.- dtypeExtensionDtype
Construct for this particular dtype. This should be a Dtype compatible with the ExtensionArray.
- copybool, default False
If True, copy the underlying data.
- Returns:
- ExtensionArray
See also
api.extensions.ExtensionArray._from_sequence
Construct a new ExtensionArray from a sequence of scalars.
api.extensions.ExtensionArray._from_factorized
Reconstruct an ExtensionArray after factorization.
api.extensions.ExtensionArray._from_scalars
Strict analogue to _from_sequence, allowing only sequences of scalars that should be specifically inferred to the given dtype.
Examples
>>> pd.arrays.IntegerArray._from_sequence_of_strings( ... ["1", "2", "3"], dtype=pd.Int64Dtype() ... ) <IntegerArray> [1, 2, 3] Length: 3, dtype: Int64