def _cast_to_array_dtype(in1, in2):
 if numpy.issubdtype(in2.dtype, numpy.float):
  in1 = in1.real.astype(in2.dtype)
 else:
  in1 = in1.astype(in2.dtype)
 return in1

def _cast_to_array_dtype ( in1 , in2 ) : if numpy . issubdtype ( in2 . dtype , numpy . float ) : in1 = in1 . real . astype ( in2 . dtype ) else : in1 = in1 . astype ( in2 . dtype ) return in1
cast array to dtype of other array .