This actually doesn't have anything to do with using an array at all, it's just that float doesn't deal well with anything but digits and the . symbol. So your commas are throwing off the function because it doesn't know what to make of them.
If you call replace(',', '') to remove the commas, then it would parse fine:
>>> float("2,143,562")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
float("2,143,562")
ValueError: invalid literal for float(): 2,143,562
>>> float("2,143,562".replace(',', ''))
2143562.0
Since you need to do it to a full list, I suggest using map with a short function that you write yourself. Something like this:
def make_float(string):
try:
return float(string.replace(',', ''))
except ValueError:
return string
map(make_float, brandprice)
This will strip commas from the string and then attempt to turn it into a float. If errors arise the original string is returned unchanged (as in your sample data you showed some strings like '-' which wont be parsed.
2,143,562is invalid for a float. You'd need to strip the commas out of that to get a valid number. Does2,143,562really represent2143562?