Skip to content

Commit 6a1d822

Browse files
fix doctest
1 parent cddc939 commit 6a1d822

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pandas/core/construction.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ def array(
210210
[1, 2, <NA>]
211211
Length: 3, dtype: Int64
212212
213+
>>> pd.array([1.1, 2.2])
214+
<FloatingArray>
215+
[1.1, 2.2]
216+
Length: 2, dtype: Float64
217+
213218
>>> pd.array(["a", None, "c"])
214219
<StringArray>
215220
['a', <NA>, 'c']
@@ -236,10 +241,10 @@ def array(
236241
If pandas does not infer a dedicated extension type a
237242
:class:`arrays.PandasArray` is returned.
238243
239-
>>> pd.array([1.1, 2.2])
244+
>>> pd.array([1 + 1j, 3 + 2j])
240245
<PandasArray>
241-
[1.1, 2.2]
242-
Length: 2, dtype: float64
246+
[(1+1j), (3+2j)]
247+
Length: 2, dtype: complex128
243248
244249
As mentioned in the "Notes" section, new extension types may be added
245250
in the future (by pandas or 3rd party libraries), causing the return

0 commit comments

Comments
 (0)