Does cmath operate on arrays? Does cmath operate on arrays? rj771972 (Programmer) (OP) 1 Jul 15 13:29 Hello, In Matlab I can do in one line: c=a+j*b where j=sqrt(-1) and a,b,c are arrays. Can I do this in python using cmath? Thanks Robert RE: Does cmath operate on arrays? salgerman (Programmer) 5 Jul 15 13:23 I don't think cmath works on arrays, only on scalars (or length-1 arrays). The thing is that you don't need cmath for what you want to do, all you need are numpy arrays; you operation would than look like this: c = a + b*1j j is already defined in python and it can be best used with the accompanying 1, i.e., "1j"