DataFile.closest¶
- DataFile.closest(value, xcol=None)¶
Return the row in a data file which has an x-column value closest to the given value.
- Parameters:
value (float) – Value to search for.
- Keyword Arguments:
xcol (index or None) – Column in which to look for value, or None to use setas.
- Returns:
ndarray – A single row of data as a
Stoner.Core.DataArray
.
Notes
To find which row it is that has been returned, use the
Stoner.Core.DataArray.i
index attribute.