pub fn from_exact_iter(py: Python<'_>, iter: impl ExactSizeIterator<Item = T>) -> &Self {
        let array = Self::new(py, [iter.len()], false);
        unsafe {
            for (i, item) in iter.enumerate() {
                *array.uget_mut([i]) = item;
            }
        }
        array
    }
/// Construct one-dimension PyArray from a type which implements
/// [`ExactSizeIterator`](https://doc.rust-lang.org/std/iter/trait.ExactSizeIterator.html).
///
/// # Example
/// ```
/// use numpy::PyArray;
/// use std::collections::BTreeSet;
/// let vec = vec![1, 2, 3, 4, 5];
/// pyo3::Python::with_gil(|py| {
///     let pyarray = PyArray::from_exact_iter(py, vec.iter().map(|&x| x));
///     assert_eq!(pyarray.readonly().as_slice().unwrap(), &[1, 2, 3, 4, 5]);
/// });
/// ```
Construct one-dimension PyArray from a type which implements
[`ExactSizeIterator`].
Construct one - dimension PyArray from a type which implements [ ` ExactSizeIterator ` ] .
pub fn from_exact_iter(py: Python<'_>, iter: impl ExactSizeIterator<Item = T>) -> &Self {
        let array = Self::new(py, [iter.len()], false);
        unsafe {
            for (i, item) in iter.enumerate() {
                *array.uget_mut([i]) = item;
            }
        }
        array
    }
pub fn from_exact_iter ( py : Python < ' _ > , iter : impl ExactSizeIterator < Item = T > ) -> & Self { let array = Self :: new ( py , [ iter . len ( ) ] , false ) ; unsafe { for ( i , item ) in iter . enumerate ( ) { * array . uget_mut ( [ i ] ) = item ; } } array }
Construct one-dimension PyArray from a type which implements
[`ExactSizeIterator`](https://doc.rust-lang.org/std/iter/trait.ExactSizeIterator.html).
Construct one - dimension PyArray from a type which implements [ ` ExactSizeIterator ` ] ( https : // doc . rust - lang . org / std / iter / trait . ExactSizeIterator . html ) .
py
Python<'_>
iter
impl ExactSizeIterator<Item = T>
example
None