pandas 1.4.2

Parameters

Parameters

values : ndarray[object]

Array of object elements to convert.

na_values : set

Set of values that should be interpreted as NaN.

convert_empty : bool, default True

If an empty array-like object is encountered, whether to interpret that element as NaN or not. If set to False, a ValueError will be raised if such an element is encountered and 'coerce_numeric' is False.

coerce_numeric : bool, default False

If initial attempts to convert to numeric have failed, whether to force conversion to numeric via alternative methods or by setting the element to NaN. Otherwise, an Exception will be raised when such an element is encountered.

This boolean also has an impact on how conversion behaves when a numeric array has no suitable numerical dtype to return (i.e. uint64, int32, uint8). If set to False, the original object array will be returned. Otherwise, a ValueError will be raised.

convert_to_masked_nullable : bool, default False

Whether to return a mask for the converted values. This also disables upcasting for ints with nulls to float64.

Returns :
------- :
np.ndarray :

Array of converted object values to numerical ones.

Optional[np.ndarray] :

If convert_to_masked_nullable is True, returns a boolean mask for the converted values, otherwise returns None.

Convert object array to a numeric array if possible.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: None#None
type: <class 'builtin_function_or_method'>
Commit: