The numpy.real and numpy.imag functions show what is IMHO inconsistent behaviour compared to other numpy functions - when they are given a a single value as parameter (as opposed to array) they return an array instead of a single value. Compare this to the behaviour of numpy.angle, numpy.conj, numpy.sin, etc. functions which return a scalar when given a scalar. Example code:
np.version
'1.11.1'
a = 1.0 + 1j
np.real(a)
array(1.0)
np.imag(a)
array(1.0)
np.angle(a)
0.78539816339744828
np.conj(a)
(1-1j)