NumPy - Array Data Types
You have a numpy array
z = np.array([1+1j, 0+0j, -1-1j], dtype=np.complex128). You want to create a new array that contains the magnitudes but replaces zeros with the string 'zero'. Which code correctly does this?