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