Skip to content

Commit c043855

Browse files
authored
Merge pull request #780 from jturner314/fix-ndarray-for-numpy-users-from_iter
Fix flatten example in ndarray_for_numpy_users
2 parents c20458a + 4e08989 commit c043855

File tree

1 file changed

+1
-1
lines changed
  • src/doc/ndarray_for_numpy_users

1 file changed

+1
-1
lines changed

src/doc/ndarray_for_numpy_users/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@
536536
//! `a[:,np.newaxis]` or `np.expand_dims(a, axis=1)` | [`a.insert_axis(Axis(1))`][.insert_axis()] | create an array from `a`, inserting a new axis 1
537537
//! `a.transpose()` or `a.T` | [`a.t()`][.t()] or [`a.reversed_axes()`][.reversed_axes()] | transpose of array `a` (view for `.t()` or by-move for `.reversed_axes()`)
538538
//! `np.diag(a)` | [`a.diag()`][.diag()] | view the diagonal of `a`
539-
//! `a.flatten()` | [`Array::from_iter(a.iter())`][::from_iter()] | create a 1-D array by flattening `a`
539+
//! `a.flatten()` | [`use std::iter::FromIterator; Array::from_iter(a.iter().cloned())`][::from_iter()] | create a 1-D array by flattening `a`
540540
//!
541541
//! ## Iteration
542542
//!

0 commit comments

Comments
 (0)