I tried to create turn a python list into a numpy array, but got very unintuitive output. Certainly I did something wrong, but out of curiosity I would like to know why I got such an output. Here is my code:
import numpy as np
# Exercise 2
a = [1, 5, 3, 6, 2]
b = np.ndarray(a)
print(b, b.dtype)
the output was
[[[[[0.00000000e+000 6.93284651e-310]
[6.93284792e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]]
[[6.93284744e-310 2.20882835e-314]
[6.93284743e-310 6.93284743e-310]
[6.93284743e-310 6.93284650e-310]
[6.93284744e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]
[6.93284744e-310 6.93284744e-310]]
... (12 more blocks similar to ones above)
[[6.93284871e-310 6.93284871e-310]
[6.93284745e-310 6.93284871e-310]
[6.93284651e-310 6.93284871e-310]
[6.93284745e-310 6.93284871e-310]
[6.93284871e-310 6.93284745e-310]
[6.93284727e-310 6.93284871e-310]]]]] float64