w3resource

Pandas Series: infer_objects() function

Better dtypes for object columns

Attempt to infer better dtypes for object columns.

Attempts soft conversion of object-dtyped columns, leaving non-object and unconvertible columns unchanged. The inference rules are the same as during normal Series/DataFrame construction.

Syntax:

Series.infer_objects(self)
Pandas Series infer_objects() function

Returns: converted - same type as input object

Example:


Download the above Notebook from here.



Inviting useful, relevant, well-written and unique guest posts