extract ints from strings in Pandas code example Example: extract ints from strings in Pandas df['B'].str.extract('(\d+)').astype(int)