0

I'm doing some calculation with numpy arrays and I'm having some problems with precision. I have a list

pop= [[-0.9710937996910745, -3.3798035014183636], [-0.9710937996910731, -3.3798035014183654]]

and I try to put into numpy.array

X1 = numpy.empty((2), dtype=float64)

for i in range(2):
    X1[i] = pop[i][0]

but I get

> print(X1)

[[-0.9710938]
 [-0.9710938]]
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
nuno
  • 1
  • 4
    Possible duplicate of [Printing numpy.float64 with full precision](https://stackoverflow.com/questions/12956333/printing-numpy-float64-with-full-precision) or [How to pretty-print a numpy.array without scientific notation and with given precision?](https://stackoverflow.com/questions/2891790/how-to-pretty-print-a-numpy-array-without-scientific-notation-and-with-given-pre) – walnut Oct 27 '19 at 04:25
  • 1
    This is just a display difference, not a change in actual precision. Look at `X1[0,0]`. – hpaulj Oct 27 '19 at 06:38

0 Answers0