change dtype object to int code example Example: how to change dtype object to int df['purchase'].astype(int)