Skip to content

Commit 123c777

Browse files
update docstrings
1 parent 64ea6a8 commit 123c777

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pandas/core/arrays/string_.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ class StringDtype(StorageExtensionDtype):
126126
Examples
127127
--------
128128
>>> pd.StringDtype()
129-
<StringDtype(storage='python', na_value=<NA>)>
130-
131-
>>> pd.StringDtype(storage="pyarrow")
132129
<StringDtype(na_value=<NA>)>
130+
131+
>>> pd.StringDtype(storage="python")
132+
<StringDtype(storage='python', na_value=<NA>)>
133133
"""
134134

135135
@property
@@ -612,7 +612,7 @@ class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc]
612612
Examples
613613
--------
614614
>>> pd.array(["This is", "some text", None, "data."], dtype="string")
615-
<StringArray>
615+
<ArrowStringArray>
616616
['This is', 'some text', <NA>, 'data.']
617617
Length: 4, dtype: string
618618
@@ -624,15 +624,15 @@ class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc]
624624
['1', 1]
625625
Length: 2, dtype: object
626626
>>> pd.array(["1", 1], dtype="string")
627-
<StringArray>
627+
<ArrowStringArray>
628628
['1', '1']
629629
Length: 2, dtype: string
630630
631631
However, instantiating StringArrays directly with non-strings will raise an error.
632632
633633
For comparison methods, `StringArray` returns a :class:`pandas.BooleanArray`:
634634
635-
>>> pd.array(["a", None, "c"], dtype="string") == "a"
635+
>>> pd.array(["a", None, "c"], dtype="string[python]") == "a"
636636
<BooleanArray>
637637
[True, <NA>, False]
638638
Length: 3, dtype: boolean

pandas/core/construction.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ def array(
230230
Length: 2, dtype: Float64
231231
232232
>>> pd.array(["a", None, "c"])
233-
<StringArray>
233+
<ArrowStringArray>
234234
['a', <NA>, 'c']
235235
Length: 3, dtype: string
236236
237-
>>> with pd.option_context("string_storage", "pyarrow"):
237+
>>> with pd.option_context("string_storage", "python"):
238238
... arr = pd.array(["a", None, "c"])
239239
>>> arr
240-
<ArrowStringArray>
240+
<StringArray>
241241
['a', <NA>, 'c']
242242
Length: 3, dtype: string
243243

0 commit comments

Comments
 (0)