df['purchase'].astype(int)

Read more of this post