convert object data type to int pandas code example
Example 1: object to int64 pandas
>>> df['purchase'].astype(str).astype(int)
Example 2: change dataframe column type
>>> df.astype({'col1': 'int32'}).dtypes
col1 int32
col2 int64
dtype: object