Convert float64 numpy array to floats not in scientific notation

user1205371

I currently have a numpy array of float64s:

[ -2.75090260e-08   3.11586226e-08   1.86128266e-08  -1.01560789e-07 ]

which I would like to print as for an excel spreadsheet import:

[ -.0000000275090260   .0000000311586226   .0000000186128266   -.000000101560789 ]

I've tried messing about with precision settings, but each number has its own mantissa and exponent.

Note that these output numbers can be considered a string if that makes the process easier, as they are going into a text file for excel.

Carsten

You want to print the numbers in decimal format with 16 digits precision? How about this?

a = [-2.75090260e-08, 3.11586226e-08, 1.86128266e-08, -1.01560789e-07]
print map(lambda x: "{0:.16f}".format(x), a)

This prints

['-0.0000000275090260', '0.0000000311586226', '0.0000000186128266', '-0.0000001015607890']

Update:

You don't even need the lambda. Using

map("{0:.16f}".format, a)

works just as well. Thanks @JaminSore for pointing that out.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Convert Scientific Notation to Float

From Dev

Converting an array of floats to an array of strings in scientific notation

From Dev

How to convert a numpy array from 'float64' to 'float'

From Dev

convert elements of an array from scientific notation to decimal notation in python

From Dev

Convert 2-d array of strings to float in python_removing scientific notation

From Dev

Convert 2-d array of strings to float in python_removing scientific notation

From Dev

Convert numpy array type and values from Float64 to Float32

From Dev

2D numpy array doesn't implicitly convert from int64 to float64

From Dev

When to use scientific notation for IEEE floats?

From Dev

With scientific notation, two different floats evaluate as equal

From Dev

With scientific notation, two different floats evaluate as equal

From Dev

Convert function arguments that are floats to numpy array

From Dev

Numpy convert from binary string to array of floats

From Java

Convert float to string in positional format (without scientific notation and false precision)

From Dev

Convert float to string in positional format (without scientific notation and false precision)

From Dev

How to convert decimal scientific notation float/double to normal string

From Dev

Convert scientific notation string into int

From Dev

Convert Double to Scientific Notation in swift

From Dev

Convert to scientific notation, Python 2.7

From Dev

Convert Scientific notation to decimal in csv

From Dev

NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?

From Dev

Sort array of numbers in Scientific Notation

From Dev

How to convert Array{Float64, 1} to float in julia?

From Dev

float changing to scientific notation on insert

From Dev

How to convert a Tuple{Array{Float64,1},Array{Float64,1}} to Array{Tuple{Float64,Float64},1} in julia

From Dev

How to convert a Tuple{Array{Float64,1},Array{Float64,1}} to Array{Tuple{Float64,Float64},1} in julia

From Dev

reading scientific notation csv file with numpy

From Dev

Why doesn't scientific notation work in Numpy

From Dev

Convert QString/QByteArray to Scientific Notation qt

Related Related

  1. 1

    Convert Scientific Notation to Float

  2. 2

    Converting an array of floats to an array of strings in scientific notation

  3. 3

    How to convert a numpy array from 'float64' to 'float'

  4. 4

    convert elements of an array from scientific notation to decimal notation in python

  5. 5

    Convert 2-d array of strings to float in python_removing scientific notation

  6. 6

    Convert 2-d array of strings to float in python_removing scientific notation

  7. 7

    Convert numpy array type and values from Float64 to Float32

  8. 8

    2D numpy array doesn't implicitly convert from int64 to float64

  9. 9

    When to use scientific notation for IEEE floats?

  10. 10

    With scientific notation, two different floats evaluate as equal

  11. 11

    With scientific notation, two different floats evaluate as equal

  12. 12

    Convert function arguments that are floats to numpy array

  13. 13

    Numpy convert from binary string to array of floats

  14. 14

    Convert float to string in positional format (without scientific notation and false precision)

  15. 15

    Convert float to string in positional format (without scientific notation and false precision)

  16. 16

    How to convert decimal scientific notation float/double to normal string

  17. 17

    Convert scientific notation string into int

  18. 18

    Convert Double to Scientific Notation in swift

  19. 19

    Convert to scientific notation, Python 2.7

  20. 20

    Convert Scientific notation to decimal in csv

  21. 21

    NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?

  22. 22

    Sort array of numbers in Scientific Notation

  23. 23

    How to convert Array{Float64, 1} to float in julia?

  24. 24

    float changing to scientific notation on insert

  25. 25

    How to convert a Tuple{Array{Float64,1},Array{Float64,1}} to Array{Tuple{Float64,Float64},1} in julia

  26. 26

    How to convert a Tuple{Array{Float64,1},Array{Float64,1}} to Array{Tuple{Float64,Float64},1} in julia

  27. 27

    reading scientific notation csv file with numpy

  28. 28

    Why doesn't scientific notation work in Numpy

  29. 29

    Convert QString/QByteArray to Scientific Notation qt

HotTag

Archive