I need my original array back, get me back pls


import numpy as np

ar1 = np.arange(4).reshape((2,2))

print (ar1)

#load to np

np.savetxt(“twoToTwo”, ar1, delimiter=’,’)

#load back to arr

reload_ar = np.loadtxt(“twoToTwo”, delimiter=",")




[[0 1] [2 3]] -→ [[0. 1.] [2. 3.]]

but i need my original array back, How?

…just for fun

To do so,

You can add another argument to this call as follows:

np.loadtxt(“twoToTwo”, dtype=np.int32, delimiter=",")
1 Like

yup, it worked by the way

why can’t np.64?

i got my principle back. Thk

Anyone would do the job, it’s just the difference in number of bits allocated to the variable int.

1 Like