[Baypiggies] scientific notation: string to int

James Tatum jtatum at gmail.com
Wed Dec 8 22:41:09 CET 2010


Scientific/exponential notation is handled natively by floats:

>>> float('2e10')
20000000000.0
>>> float('2e100')
2e+100
>>> float('2e-10')
2.0000000000000001e-10

On Wed, Dec 8, 2010 at 1:24 PM, Bryce Verdier <bryceverdier at gmail.com> wrote:
> So I've been given a project for work, a large CSV file with many many
> numbers and such to parse through. The lines that look like this:
>
> b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec  2 00:00:00 UTC
> 2010,2.96116E+11,0,0, Thu Dec  2 00:00:00 UTC 2010,577078067
> 20,15228831373,80966857300,
>
> so I'm curious if there is a way to turn the string of scientific notion
> into the actual numerical value?
>
> All ideas are welcomed and thank in advance,
>
> Bryce
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>


More information about the Baypiggies mailing list