Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({"X": ["p", 2, 3, 4]})
df = df.iloc[1:]
df
Out[2]:
X
1 2
2 3
3 4
In [3]:
df.dtypes
Out[3]:
X    object
dtype: object
In [4]:
df.infer_objects().dtypes
Out[4]:
X    int64
dtype: object