I want to save a 3D binary array in .txt file or .csv file on python and import it onto mathematica.
I googled and I found a lot of answers, I try this:
import numpy as np
a=np.zeros((2,3,4))
a[0,0,0]=10
cPickle.dump( a, open( "matrix.txt", "wb" ) )
In mathematica I have used the Import["matrix.txt","Data"] and I did not get what I expect
IN[]:Import["matrix.txt", "Data"]
Out[]:{{"cnumpy.core.multiarray"}, {"_reconstruct"}, {"p1"}, {"(cnumpy"}, \
{"ndarray"}, {"p2"}, {"(I0"}, {"tS'b'"}, {"tRp3"}, {"(I1"}, {"(I2"}, \
{"I3"}, {"I4"}, {"tcnumpy"}, {"dtype"}, {"p4"}, {"(S'f8'"}, {"I0"}, \
{"I1"}, {"tRp5"}, {"(I3"}, {"S'<'"}, {"NNNI-1"}, {"I-1"}, {"I0"}, \
{"tbI00"}, \
{"S'\\x00\\x00\\x00\\x00\\x00\\x00$@\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\
x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'"}, {"tb."}}