# Create a dictionary that maps strings to integers mapping = {'a':8, 'b':23, 'c':45} # Convert the 'stop_duration' strings to integers using the 'mapping' df['column'] = df.column.map(mapping)