I am trying to replace a value in a pandas dataframe cell that I am constructing from a JSON file that I get from Airtable API the JSON file looks like this one:
Obviously this is a sample and I am replacing the real keys and some values, because they are from a private application, but what I am trying to do once I get the API response and then convert the JSON into a dataframe using the code below, is to replace the values {"specialValue": "Infinity"}
from roi key and {"specialValue": "NaN"}
from investment_return key with zeros:
Then once I have the JSON data converted into a dataframe I am trying to replace the values using this code:
df.replace('{"specialValue": "Infinity"}', np.nan, inplace=True)
For some reason is not working:
Can somebody give me a possible approach on how to convert those into zeros?