ColumnIndexesByNames returns the indexes of the given column names. idxs have -1 if name not found -- see Try version for error message.
(names ...string)
| 106 | // ColumnIndexesByNames returns the indexes of the given column names. |
| 107 | // idxs have -1 if name not found -- see Try version for error message. |
| 108 | func (dt *Table) ColumnIndexesByNames(names ...string) []int { |
| 109 | nc := len(names) |
| 110 | if nc == 0 { |
| 111 | return nil |
| 112 | } |
| 113 | cidx := make([]int, nc) |
| 114 | for i, cn := range names { |
| 115 | cidx[i] = dt.ColumnIndex(cn) |
| 116 | } |
| 117 | return cidx |
| 118 | } |
| 119 | |
| 120 | // ColumnName returns the name of given column |
| 121 | func (dt *Table) ColumnName(i int) string { |
no test coverage detected