There are many ways to check if a type is complex, but I do not think using the typecodes dictionary is the best way.    Alternatives:

'''python
issubclass(lhs.dtype.type, np.complexfloating)
''' 
or
'''python
lhs.dtype.kind == 'c'
'''