-1
我的代碼:所有輸入數組必須具有相同的維數蟒
GL_A = [2,3,4,5,6,7,8]
DB_c = [88]
writer.writerow(numpy.append(GL_A[i],DB_c[j], index))
的錯誤:
Traceback (most recent call last):
File "<ipython-input-61-16267abc0150>", line 1, in <module>
runfile('C:/Users/cp1/PythonScript/linearregression.py', wdir='C:/Users/cp1/PythonScript')
File "C:\Users\cp1\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\cp1\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/cp1/PythonScript/linearregression.py", line 59, in <module>
writer.writerow(numpy.append(GL_Account_Number[i],DB_clusters[j], index))
File "C:\Users\cp1\AppData\Local\Continuum\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 4586, in append
return concatenate((arr, values), axis=axis)
ValueError: all the input arrays must have same number of dimensions
,我想有輸出是COLUMN1所有GL_A的元素和重複88的列2(DB_c)
有什麼建議嗎?
這是否解決了您的問題? – Chuck