Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does NumPy implement its complex number literal?

Tags:

python

numpy

Using complex number in Numpy is as simple as np.exp(1+ 2.3j). How to implement this simple notation? What is 2.3j? It's not like that it is a variable name.

like image 637
golopot Avatar asked Dec 10 '25 19:12

golopot


1 Answers

Complex numbers are a built-in data type in Python.

You can do complex number operations right inside the interpreter without numpy if you like:

>> (2+3j) * (-1j)
(3-2j)
like image 97
eigenchris Avatar answered Dec 13 '25 08:12

eigenchris