'Object of type complex is not JSon serializable: ignore expressions burried in a string?

So I have a massing csv dump that I need to parse to JSON. Among those csv fields, there are comment fields, similar to this one:

2999.99 + 90J

which I guess is meant as a price and a number of days, but then when I get to dumping this as JSON it shows up as

(2999.99+90j)

Which is a complex number and not json seriablizable. I guess I could try to find & replace all border cases, but I'd rather just tell json/python to ignore any complex number representation? Is there some way to do that? Or do I really need to go through all the data? A quick search tells me there are a least a few problematic comments like that, so I'd rather not....



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source