python - Import/export high rank numpy array to text file -


I have a high ranked egg. For example, size (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?

You can use 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))   

To import data and resize it, you For example, for example:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -