I want to represent a complex number / an array of complex numbers as c = a + bj
, where a and b are two variables. I know I can do c = a + b*(1j)
or c = complex(a, b)
. But if a and b are arrays, then c = complex(a, b)
won't work. Is c = a + b*(1j)
the best way?
Asked
Active
Viewed 22 times
0

user202729
- 3,358
- 3
- 25
- 36

Consideration
- 182
- 1
- 1
- 12
-
1Add a programming language tag. – user202729 Feb 12 '21 at 02:32
-
1And are you using numpy? – user202729 Feb 12 '21 at 02:33
-
1In that case you're looking for [python - Numpy: Creating a complex array from 2 real ones? - Stack Overflow](https://stackoverflow.com/questions/2598734/numpy-creating-a-complex-array-from-2-real-ones) – user202729 Feb 12 '21 at 02:33
-
@user202729 Thank you for the suggestion in the link. I think that's a good solution. – Consideration Feb 12 '21 at 02:49
-
3Does this answer your question? [Numpy: Creating a complex array from 2 real ones?](https://stackoverflow.com/questions/2598734/numpy-creating-a-complex-array-from-2-real-ones) – user202729 Feb 12 '21 at 02:50
-
@user202729 Yes, thank you! – Consideration Feb 12 '21 at 04:05