I need my original array back, get me back pls

#recap

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=",")

print(reload_ar)

print(orig_ar)

o/p:

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

but i need my original array back, How?

…just for fun

Hi,
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