Float returns the float64 value of cell at given column (by name), row index for columns that have 1-dimensional tensors. Returns NaN if column is not a 1-dimensional tensor or col name not found, or row not valid.
(column string, row int)
| 456 | // for columns that have 1-dimensional tensors. |
| 457 | // Returns NaN if column is not a 1-dimensional tensor or col name not found, or row not valid. |
| 458 | func (dt *Table) Float(column string, row int) float64 { |
| 459 | if !dt.IsValidRow(row) { |
| 460 | return math.NaN() |
| 461 | } |
| 462 | ct := dt.ColumnByName(column) |
| 463 | if ct == nil { |
| 464 | return math.NaN() |
| 465 | } |
| 466 | if ct.NumDims() != 1 { |
| 467 | return math.NaN() |
| 468 | } |
| 469 | return ct.Float1D(row) |
| 470 | } |
| 471 | |
| 472 | // StringIndex returns the string value of cell at given column, row index |
| 473 | // for columns that have 1-dimensional tensors. |