You should rather use 'copy=True', in check_arrays, 2 lines below. Indeed, if the dtype is not float64, you will copy the data twice.