pub fn copy_to<U: Element>(&self, other: &PyArray<U, D>) -> PyResult<()> {
        let self_ptr = self.as_array_ptr();
        let other_ptr = other.as_array_ptr();
        let result = unsafe { PY_ARRAY_API.PyArray_CopyInto(other_ptr, self_ptr) };
        if result == -1 {
            Err(PyErr::fetch(self.py()))
        } else {
            Ok(())
        }
    }
/// Copies self into `other`, performing a data-type conversion if necessary.
/// # Example
/// ```
/// use numpy::PyArray;
/// pyo3::Python::with_gil(|py| {
///     let pyarray_f = PyArray::arange(py, 2.0, 5.0, 1.0);
///     let pyarray_i = PyArray::<i64, _>::new(py, [3], false);
///     assert!(pyarray_f.copy_to(pyarray_i).is_ok());
///     assert_eq!(pyarray_i.readonly().as_slice().unwrap(), &[2, 3, 4]);
/// });
/// ```
Copies self into `other`, performing a data-type conversion if necessary.
Copies self into ` other ` performing a data - type conversion if necessary .
pub fn copy_to<U: Element>(&self, other: &PyArray<U, D>) -> PyResult<()> {
        let self_ptr = self.as_array_ptr();
        let other_ptr = other.as_array_ptr();
        let result = unsafe { PY_ARRAY_API.PyArray_CopyInto(other_ptr, self_ptr) };
        if result == -1 {
            Err(PyErr::fetch(self.py()))
        } else {
            Ok(())
        }
    }
pub fn copy_to < U : Element > ( & self , other : & PyArray < U , D > ) -> PyResult < ( ) > { let self_ptr = self . as_array_ptr ( ) ; let other_ptr = other . as_array_ptr ( ) ; let result = unsafe { PY_ARRAY_API . PyArray_CopyInto ( other_ptr , self_ptr ) } ; if result == - 1 { Err ( PyErr :: fetch ( self . py ( ) ) ) } else { Ok ( ( ) ) } }
Copies self into `other`, performing a data-type conversion if necessary.
Copies self into ` other ` performing a data - type conversion if necessary .
&self
other
&PyArray<U, D>
example
None