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) {
59
59
60
60
fn turn_on_corners ( z : & mut Board ) {
61
61
let n = z. nrows ( ) ;
62
- let m = z. cols ( ) ;
62
+ let m = z. ncols ( ) ;
63
63
z[ [ 1 , 1 ] ] = 1 ;
64
64
z[ [ 1 , m - 2 ] ] = 1 ;
65
65
z[ [ n - 2 , 1 ] ] = 1 ;
Original file line number Diff line number Diff line change 554
554
//! NumPy | `ndarray` | Notes
555
555
//! ------|-----------|------
556
556
//! `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
558
558
//! `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
559
559
//! `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
560
560
//! `a.shape[0] == a.shape[1]` | [`a.is_square()`][.is_square()] | check if the array is square
571
571
//! [.assign()]: ../../struct.ArrayBase.html#method.assign
572
572
//! [.axis_iter()]: ../../struct.ArrayBase.html#method.axis_iter
573
573
//! [azip!]: ../../macro.azip.html
574
- //! [.cols ()]: ../../struct.ArrayBase.html#method.cols
574
+ //! [.ncols ()]: ../../struct.ArrayBase.html#method.ncols
575
575
//! [.column()]: ../../struct.ArrayBase.html#method.column
576
576
//! [.column_mut()]: ../../struct.ArrayBase.html#method.column_mut
577
577
//! [CowArray]: ../../type.CowArray.html
Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ pub type Ixs = isize;
409
409
/// Zip::from(a.genrows())
410
410
/// .and(&mut b)
411
411
/// .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];
413
413
/// });
414
414
/// ```
415
415
///
You can’t perform that action at this time.
0 commit comments