python - Import/export high rank numpy array to text file -
I have a high ranked egg. For example, size You can use To import data and resize it, you For example, for example: (100,100,100,2) . What is the best way to write it in a text file, so it is easy to import into other programs as well as numpy?
np.savetxt if you flatten the array And its first line, if you include the array size in the header). This way you know that when you open it in another program, then how to redraw the array:
import such as np a = np.random.rand (100,100,100,2 ) Np.savetxt ('test .txt', a.flatten (), header = str (a.shape))
Comments
Post a Comment