What you are looking for is:
np.set_printoptions(suppress=True)
However, keep that in mind that it is just printing style. Internally, they are all stored in floating point (includes mantissa and exponent) format. Also, note that if the ratio of largest number to smallest number is larger than mantissa size can handle (which I think is around 51 bits), it is going to force scientific notation even with setting suppress=True
.
sample code:
a = np.array([1.234,0.0000002, 1000000])
np.set_printoptions(suppress=True)
[ 1.234 0.0000002 1000000. ]
You can add floatmode
argument to fill in the blanks with 0
s (it sets different styles of printing float numbers):
np.set_printoptions(suppress=True,floatmode='maxprec_equal')
[ 1.2340000 0.0000002 100000.0000000]
or
np.set_printoptions(suppress=True,floatmode='fixed')
[ 1.23400000 0.00000020 100000.00000000]
and if you add precision to it:
np.set_printoptions(suppress=True,floatmode='maxprec',precision=2)
[ 1.23 0. 100000. ]