代码:
import numpy as np;
import joblib
var=np.zeros((4, 4))
var1=np.zeros((4, 4))
va=np.concatenate(var,var1)
joblib.dump(va, '/media/ab/AB-3/file_name.dat')
aa=joblib.load('/media/ab/AB-3/file_name.dat',None)
print aa
错误:
Traceback (most recent call last):
File "/home/ab/Pictures/store.py", line 6, in <module>
va=np.concatenate(var,var1)
TypeError: only length-1 arrays can be converted to Python scalars
答案 0 :(得分:1)
查看文档http://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html
va=np.concatenate((var,var1),axis=0)