File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
doc/ndarray_for_numpy_users Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ fn iterate(z: &mut Board, scratch: &mut Board) {
5959
6060fn turn_on_corners ( z : & mut Board ) {
6161 let n = z. nrows ( ) ;
62- let m = z. cols ( ) ;
62+ let m = z. ncols ( ) ;
6363 z[ [ 1 , 1 ] ] = 1 ;
6464 z[ [ 1 , m - 2 ] ] = 1 ;
6565 z[ [ n - 2 , 1 ] ] = 1 ;
Original file line number Diff line number Diff line change 554554//! NumPy | `ndarray` | Notes
555555//! ------|-----------|------
556556//! `len(a)` or `a.shape[0]` | [`a.nrows()`][.nrows()] | get the number of rows in a 2-D array
557- //! `a.shape[1]` | [`a.cols ()`][.cols ()] | get the number of columns in a 2-D array
557+ //! `a.shape[1]` | [`a.ncols ()`][.ncols ()] | get the number of columns in a 2-D array
558558//! `a[1]` or `a[1,:]` | [`a.row(1)`][.row()] or [`a.row_mut(1)`][.row_mut()] | view (or mutable view) of row 1 in a 2-D array
559559//! `a[:,4]` | [`a.column(4)`][.column()] or [`a.column_mut(4)`][.column_mut()] | view (or mutable view) of column 4 in a 2-D array
560560//! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
571571//! [.assign()]: ../../struct.ArrayBase.html#method.assign
572572//! [.axis_iter()]: ../../struct.ArrayBase.html#method.axis_iter
573573//! [azip!]: ../../macro.azip.html
574- //! [.cols ()]: ../../struct.ArrayBase.html#method.cols
574+ //! [.ncols ()]: ../../struct.ArrayBase.html#method.ncols
575575//! [.column()]: ../../struct.ArrayBase.html#method.column
576576//! [.column_mut()]: ../../struct.ArrayBase.html#method.column_mut
577577//! [CowArray]: ../../type.CowArray.html
Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ pub type Ixs = isize;
409409/// Zip::from(a.genrows())
410410/// .and(&mut b)
411411/// .apply(|a_row, b_elt| {
412- /// *b_elt = a_row[a.cols () - 1] - a_row[0];
412+ /// *b_elt = a_row[a.ncols () - 1] - a_row[0];
413413/// });
414414/// ```
415415///
You can’t perform that action at this time.
0 commit comments