MCPcopy Create free account
hub / github.com/daniel-e/rustml / column

Method column

src/matrix.rs:741–747  ·  view source on GitHub ↗

Returns a copy of the column at the specified index.

(&self, pos: usize)

Source from the content-addressed store, hash-verified

739
740 /// Returns a copy of the column at the specified index.
741 pub fn column(&self, pos: usize) -> Option<Vec<T>> {
742
743 if pos >= self.cols() {
744 return None;
745 }
746 Some(self.row_iter().map(|r| r[pos].clone()).collect::<Vec<T>>())
747 }
748
749 pub fn rm_column(&self, pos: usize) -> Option<Matrix<T>> {
750

Callers 2

mainFunction · 0.80

Calls 3

colsMethod · 0.80
mapMethod · 0.80
row_iterMethod · 0.80

Tested by

no test coverage detected