- 采用numpy模块来进行数组的存储
三种方式:
a .
import numpy
a = [1, 2, 3, 4, 5]
numpy.save('arr1.npy', a)
b = numpy.load('arr1.npy')
b.
import numpy
a = [1, 2, 3, 4, 5]
numpy.savetxt('arr.txt',a)
b
import numpy
a = [1, 2, 3, 4, 5]
numpy.save('arr1.npy', a)
b = numpy.load('arr1.npy')
b.
import numpy
a = [1, 2, 3, 4, 5]
numpy.savetxt('arr.txt',a)
b