Name

imag, imaginary, real

Synopsis

Trying to access the a .real and a .imag attributes raises a TypeError exception unless a’s type code is complex. When a’s type code is complex, each of a .real and a .imag is a noncontiguous array with the same shape as a and a float type code, sharing data with a. By accessing or modifying a .real or a .imag, you access or modify the real or imaginary parts of a’s complex-number elements. imaginary is a synonym of imag.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.