I am using numpy and am trying the following computation:
efield = p+ (np.sqrt(-1))*q #(where p and q are arrays)
however I get the following error:
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
How is i (square root of -1) used in numpy?