String to Float, without introducing errors
Weatherby,Gerard
gweatherby at uchc.edu
Sat Dec 17 06:59:59 EST 2022
https://docs.python.org/3/library/decimal.html
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Python-list <python-list-bounces+gweatherby=uchc.edu at python.org> on behalf of Paul St George <email at paulstgeorge.com>
Sent: Saturday, December 17, 2022 6:51:17 AM
To: python-list at python.org <python-list at python.org>
Subject: String to Float, without introducing errors
*** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. ***
I have a large/long array of numbers in an external file. The numbers look like this:
-64550.727
-64511.489
-64393.637
-64196.763
-63920.2
-63563.037
-63124.156
-62602.254
-61995.895
-61303.548
-60523.651
-59654.66
...
When I bring the numbers into my code, they are Strings. To use the numbers in my code, I want to change the Strings to Float type because the code will not work with Strings but I do not want to change the numbers in any other way.
So, I want my Strings (above) to be these numbers.
-64550.727
-64511.489
-64393.637
-64196.763
-63920.2
-63563.037
-63124.156
-62602.254
-61995.895
-61303.548
-60523.651
-59654.66
...
Please help!
--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!guE_zPsjxMW4k6nHIdOqZbrt8SdjUC9GELXgSHatARIr2PrAYr6tXCmixkZGNocjsf9SKLduQFjZjM7tOeaQ$
More information about the Python-list
mailing list