def _convert_array(array, dtype):
 if (array.dtype == dtype):
  return array
 elif ((array.dtype.itemsize == dtype.itemsize) and (not (np.issubdtype(array.dtype, np.number) and np.issubdtype(dtype, np.number)))):
  return array.view(dtype)
 else:
  return array.astype(dtype)

def _convert_array ( array , dtype ) : if ( array . dtype == dtype ) : return array elif ( ( array . dtype . itemsize == dtype . itemsize ) and ( not ( np . issubdtype ( array . dtype , np . number ) and np . issubdtype ( dtype , np . number ) ) ) ) : return array . view ( dtype ) else : return array . astype ( dtype )
converts an array to a new dtype--if the itemsize of the new dtype is the same as the old dtype and both types are not numeric .