pub fn shape(&self) -> &[usize] {
        let n = self.ndim();
        let ptr = self.as_array_ptr();
        unsafe {
            let p = (*ptr).dimensions as *mut usize;
            slice::from_raw_parts(p, n)
        }
    }
/// Returns a slice which contains dimmensions of the array.
///
/// Same as [numpy.ndarray.shape](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.shape.html)
/// # Example
/// ```
/// use numpy::PyArray3;
/// pyo3::Python::with_gil(|py| {
///     let arr = PyArray3::<f64>::new(py, [4, 5, 6], false);
///     assert_eq!(arr.shape(), &[4, 5, 6]);
/// });
/// ```
// C API: https://numpy.org/doc/stable/reference/c-api/array.html#c.PyArray_DIMS
Returns a slice which contains dimmensions of the array.
Returns a slice which contains dimmensions of the array .
pub fn shape(&self) -> &[usize] {
        let n = self.ndim();
        let ptr = self.as_array_ptr();
        unsafe {
            let p = (*ptr).dimensions as *mut usize;
            slice::from_raw_parts(p, n)
        }
    }
pub fn shape ( & self ) -> & [ usize ] { let n = self . ndim ( ) ; let ptr = self . as_array_ptr ( ) ; unsafe { let p = ( * ptr ) . dimensions as * mut usize ; slice :: from_raw_parts ( p , n ) } }
Returns a slice which contains dimmensions of the array.
Returns a slice which contains dimmensions of the array .
&self
example
None