2014-03-29 1250 views
7

在我的計劃,描繪出粒子的路徑,我得到以下錯誤:類型錯誤與ufunc bitwise_xor

Traceback (most recent call last): 
    File "C:\Users\Felix\Google Drive\Research\particles.py", line 154, in <module> 
    bfield += b_X(r_p(r,pos[2]))*(r_p(r,pos[2])/r) 
    *((r-r_p(r,pos[2]))**2+pos[2]**2)^(-1/2)*np.array 
    ([(1-r_p(r,pos[2])/r)*pos[0],(1-r_p(r,pos[2])/r)*pos[1],pos[2]]) 

TypeError: ufunc 'bitwise_xor' not supported for the input types, 
and the inputs could not be safely coerced to any supported types 
according to the casting rule ''safe'' 

我似乎無法找到發生了什麼事情。我沒有任何xor的實例(儘管我想它可能是在if/else語句中編碼的)。

回答