I am working a database that is very poorly organized. There are CustomerIds that are somehow bigger than int64. Here is an example: 88168142359034442077.0
In order to be able to use this ID, I need to turn it into a string and remove the decimal. I have tried to use the following code:
testdf = pd.DataFrame({'CUSTID': ['99418675896216.02342351', '88168142359034442077.0213', '53056496953']})
testdf['CUSTID'] = testdf['CUSTID'].astype('float64').astype('int64').astype(str)
testdf.display()
When I use the above method I get an overflow and then the numbers that are bigger than int64 becomes negative like: -9223372036854775808 for 88168142359034442077.0213
I have being looking for other ways to be able to make the the change from string to float, then float to int, and finally int to string again.
One method that I tried is to just not use astype('int64'), but it makes the the output into scientific format like: 8.816814235903445e+19 for 88168142359034442077.0213 and other than using regex to remove the decimal and 'e+19' I don't really see what else I can do.
Any information is appreciated. Thanks!