@@ -1815,9 +1815,20 @@ where
1815
1815
/// number of rows and columns (or more axes if applicable), it is important to pick an index
1816
1816
/// ordering, and that's the reason for the function parameter for `order`.
1817
1817
///
1818
+ /// The `new_shape` parameter should be a dimension and an optional order like these examples:
1819
+ ///
1820
+ /// ```text
1821
+ /// (3, 4) // Shape 3 x 4 with default order (RowMajor)
1822
+ /// ((3, 4), Order::RowMajor)) // use specific order
1823
+ /// ((3, 4), Order::ColumnMajor)) // use specific order
1824
+ /// ((3, 4), Order::C)) // use shorthand for order - shorthands C and F
1825
+ /// ```
1826
+ ///
1818
1827
/// **Errors** if the new shape doesn't have the same number of elements as the array's current
1819
1828
/// shape.
1820
1829
///
1830
+ /// # Example
1831
+ ///
1821
1832
/// ```
1822
1833
/// use ndarray::array;
1823
1834
/// use ndarray::Order;
@@ -1890,10 +1901,10 @@ where
1890
1901
///
1891
1902
/// If an index ordering is not specified, the default is `RowMajor`.
1892
1903
/// The operation will only succeed if the array's memory layout is compatible with
1893
- /// the index ordering.
1904
+ /// the index ordering, so that the array elements can be rearranged in place .
1894
1905
///
1895
- /// Use `.to_shape()` instead for more flexible reshaping of arrays, which
1896
- /// allows copying elements if required.
1906
+ /// If required use `.to_shape()` or `.into_shape_clone` instead for more flexible reshaping of
1907
+ /// arrays, which allows copying elements if required.
1897
1908
///
1898
1909
/// **Errors** if the shapes don't have the same number of elements.<br>
1899
1910
/// **Errors** if order RowMajor is given but input is not c-contiguous.
@@ -1903,6 +1914,17 @@ where
1903
1914
/// reshaped using row major index ordering, column major arrays with column major index
1904
1915
/// ordering.
1905
1916
///
1917
+ /// The `new_shape` parameter should be a dimension and an optional order like these examples:
1918
+ ///
1919
+ /// ```text
1920
+ /// (3, 4) // Shape 3 x 4 with default order (RowMajor)
1921
+ /// ((3, 4), Order::RowMajor)) // use specific order
1922
+ /// ((3, 4), Order::ColumnMajor)) // use specific order
1923
+ /// ((3, 4), Order::C)) // use shorthand for order - shorthands C and F
1924
+ /// ```
1925
+ ///
1926
+ /// # Example
1927
+ ///
1906
1928
/// ```
1907
1929
/// use ndarray::{aview1, aview2};
1908
1930
/// use ndarray::Order;
@@ -1960,7 +1982,7 @@ where
1960
1982
/// is C-contig or F-contig, it follows the index order that corresponds to the memory order.
1961
1983
/// Prefer to use `.to_shape()` or `.into_shape_with_order()`.
1962
1984
///
1963
- /// Because of this, the method is deprecated. That reshapes depend on memory order is not
1985
+ /// Because of this, the method ** is deprecated** . That reshapes depend on memory order is not
1964
1986
/// intuitive.
1965
1987
///
1966
1988
/// **Errors** if the shapes don't have the same number of elements.<br>
0 commit comments