I have a table 'users'
with a column 'Internet users'
containing numeric values but they're as type object. I need to convert them to int, but:
When I try
users['Internet users'] = users['Internet users'].astype(int)
I get an error "invalid literal for int() with base 10: '1,427,647,786'"When I try
pd.to_numeric(users['Internet users'],errors='coerce')
it runs but returns all values as null. I need all the numeric values.I've tried
users['Internet users'] = int(float(users['Internet users']))
but returns an error cannot convert the series to <class 'float'>
How can I convert this column to int avoiding returning null values?