0

I have a dataframe with info on multiple countries. The data is not very clean and some of the country names have integer values in them. like this China2 or Ukraine18.

I want to remove the integer values from all entries in the Country column but am not able to find a robust way to do this. Any help is appreciated

0

1 Answer 1

2

You can use Series.str.replace:

df['Country'] = df['Country'].str.replace('\d+', '')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.