在Numpy中用i乘以矩阵

时间:2015-08-29 17:11:13

标签: python numpy numbers

我正在使用numpy并尝试以下计算:

efield = p+ (np.sqrt(-1))*q       #(where p and q are arrays)

然而我收到以下错误:

Warning (from warnings module):
  File "C:\Users\Desktop\Polarization E Feild.py", line 115
    efield = p+ (np.sqrt(-1))*q
RuntimeWarning: invalid value encountered in sqrt

Traceback (most recent call last):
  File "C:\Users\Desktop\Polarization E Feild.py", line 115, in <module>
    efield = p+ (np.sqrt(-1))*q
ValueError: cannot convert float NaN to integer

如何在numpy中使用我(-1的平方根)?

0 个答案:

没有答案