Skip to content

Commit dd02d69

Browse files
committed
update docstring
1 parent 3313f23 commit dd02d69

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

pandas/core/construction.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,24 +219,17 @@ def array(
219219
[a, b, a]
220220
Categories (3, object): [a < b < c]
221221
222-
Because omitting the `dtype` passes the data through to NumPy,
223-
a mixture of valid integers and NA will return a floating-point
224-
NumPy array.
222+
Pandas will infer an ExtensionArray for some types of data:
225223
226224
>>> pd.array([1, 2, np.nan])
227-
<PandasArray>
228-
[1.0, 2.0, nan]
229-
Length: 3, dtype: float64
230-
231-
To use pandas' nullable :class:`pandas.arrays.IntegerArray`, specify
232-
the dtype:
233-
234-
>>> pd.array([1, 2, np.nan], dtype='Int64')
235225
<IntegerArray>
236226
[1, 2, NaN]
237227
Length: 3, dtype: Int64
238228
239-
Pandas will infer an ExtensionArray for some types of data:
229+
>>> pd.array(["a", None, "c"])
230+
<StringArray>
231+
['a', nan, 'c']
232+
Length: 3, dtype: string
240233
241234
>>> pd.array([pd.Period('2000', freq="D"), pd.Period("2000", freq="D")])
242235
<PeriodArray>

0 commit comments

Comments
 (0)