Skip to content

Commit 4faffca

Browse files
committed
Update remaining instances of .cols() -> .ncols()
1 parent bd38aca commit 4faffca

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/life.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn iterate(z: &mut Board, scratch: &mut Board) {
5959

6060
fn 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;

src/doc/ndarray_for_numpy_users/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
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
@@ -571,7 +571,7 @@
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

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
///

0 commit comments

Comments
 (0)