import locale
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
locale.atoi('1,000,000')
locale.atof('1,000,000.53')
How do I use Python to convert a string to a number if it has commas in it as thousands separators?