StringArray is considered experimental. The implementation and parts of the API may change without warning.
StringArray returns a BooleanArray for comparison methods.
The array of data.
Currently, this expects an object-dtype ndarray where the elements are Python strings or :None:attr:`pandas.NA`
. This may change without warning in the future. Use :None:meth:`pandas.array`
with dtype="string"
for a stable way of creating a :None:None:`StringArray`
from any sequence.
Whether to copy the array of data.
Extension array for string data.
Series.str
The string methods are available on Series backed by a StringArray.
array
The recommended function for creating a StringArray.
>>> pd.array(['This is', 'some text', None, 'data.'], dtype="string") <StringArray> ['This is', 'some text', <NA>, 'data.'] Length: 4, dtype: string
Unlike arrays instantiated with dtype="object"
, StringArray
will convert the values to strings.
>>> pd.array(['1', 1], dtype="object") <PandasArray> ['1', 1] Length: 2, dtype: objectThis example is valid syntax, but we were not able to check execution
>>> pd.array(['1', 1], dtype="string") <StringArray> ['1', '1'] Length: 2, dtype: string
However, instantiating StringArrays directly with non-strings will raise an error.
For comparison methods, StringArray
returns a pandas.BooleanArray
:
>>> pd.array(["a", None, "c"], dtype="string") == "a" <BooleanArray> [True, <NA>, False] Length: 3, dtype: booleanSee :
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.arrays.string_.StringArray
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them