Skip to content

Commit e8591ef

Browse files
committed
Add doc-string for maybe_convert_objects
1 parent f071bf6 commit e8591ef

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pandas/_libs/lib.pyx

+26
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,33 @@ def maybe_convert_objects(ndarray[object] objects, bint try_float=0,
19621962
bint convert_to_nullable_integer=0):
19631963
"""
19641964
Type inference function-- convert object array to proper dtype
1965+
1966+
Parameters
1967+
----------
1968+
values : ndarray
1969+
Array of object elements to convert.
1970+
try_float : bool, default False
1971+
If an array-like object contains only float or NaN values is
1972+
encountered, whether to convert and return an array of float dtype.
1973+
safe : bool, default False
1974+
Whether to upcast numeric type (e.g. int cast to float). If set to
1975+
True, no upcasting will be performed.
1976+
convert_datetime : bool, default False
1977+
If an array-like object contains only datetime values or NaT is
1978+
encountered, whether to convert and return an array of M8[ns] dtype.
1979+
convert_timedelta : bool, default False
1980+
If an array-like object contains only timedelta values or NaT is
1981+
encountered, whether to convert and return an array of m8[ns] dtype.
1982+
convert_to_nullable_integer : bool, default False
1983+
If an array-like object contains only interger values (and NaN) is
1984+
encountered, whether to convert and return an IntegerArray.
1985+
1986+
Returns
1987+
-------
1988+
array : array of converted object values to more specific dtypes if
1989+
pplicable
19651990
"""
1991+
19661992
cdef:
19671993
Py_ssize_t i, n
19681994
ndarray[float64_t] floats

0 commit comments

Comments
 (0)