I have a dataframe TSRdfr which I have accessed from Eikon API on Python.
Index Instrument Total Return
1. RIO.L. 15.990065
2. AAP.A. 22.543209
and so on ....
The data type of Total Return is Object which I need to convert to float64. I am using the syntax below.
TSRdfr["Total Return"] = pd.to_numeric(TSRdfr["Total Return"], errors='coerce')
This is not converting the data type of Return from Object to float64. I tried removing errors ='coerce' to see what's happening.
I am getting an error saying: "Unable to parse NaN at position 0"
The Return numbers are accessed from Refinitiv Eikon API. I am assuming they are too large to convert to float64. Any suggestions??
I know this question is not specific to Eikon API, but some help will be appreciated.