We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cddc939 commit 6a1d822Copy full SHA for 6a1d822
pandas/core/construction.py
@@ -210,6 +210,11 @@ def array(
210
[1, 2, <NA>]
211
Length: 3, dtype: Int64
212
213
+ >>> pd.array([1.1, 2.2])
214
+ <FloatingArray>
215
+ [1.1, 2.2]
216
+ Length: 2, dtype: Float64
217
+
218
>>> pd.array(["a", None, "c"])
219
<StringArray>
220
['a', <NA>, 'c']
@@ -236,10 +241,10 @@ def array(
236
241
If pandas does not infer a dedicated extension type a
237
242
:class:`arrays.PandasArray` is returned.
238
243
239
- >>> pd.array([1.1, 2.2])
244
+ >>> pd.array([1 + 1j, 3 + 2j])
240
245
<PandasArray>
- [1.1, 2.2]
- Length: 2, dtype: float64
246
+ [(1+1j), (3+2j)]
247
+ Length: 2, dtype: complex128
248
249
As mentioned in the "Notes" section, new extension types may be added
250
in the future (by pandas or 3rd party libraries), causing the return
0 commit comments